1. Home
  2. Knowledge Base
  3. Advanced
  4. Advanced Functions: Programmer Interface

Advanced Functions: Programmer Interface

Programmer Interface

Programmer Interface

This feature allows you to type in an Omnis Studio program that can then be run. It is often the case that you want to do something with the data, perhaps to repair an error, that can only be done by a specifically written program. Such programs need to be treated with great caution and should only be written by a professional.

Field

Description

Code Text

Type or paste in Omnis Studio code. When you leave the field, it will be syntax checked.

Button

Action

Run This Program

Click to run the program that has been typed in.

Revert to Saved

Reverts to the previous state of the saved program.

Save Program

Saves the program for future use.

Standard System Methods

The following standard methods can be used:

Method syntax

Example or parameters

Function

$ctask.tData.$EditPrepNoQuit()

Set main file {CUSFILE}
Find on CUSCODE (Exact match) {‘XXXXXX’}
If flag true
Set read/write files {CUSFILE}
Do $ctask.tData.$EditPrepNoQuit()
Calculate CUSIDX2 as ‘TTTT’
Update files
Set read-only files {CUSFILE}
End If

Multi-user prepare for edit. Sets the current record of the main file into edit mode and locks it. Must be followed by an Update files command and the file must be in read/write mode.

$ctask.tData.$InsertNoQuit()

Set main file {CUSFILE}
Set read/write files {CUSFILE}
Do $ctask.tData.$InsertNoQuit()
Calculate CUSCODE as ‘XXXXXX’
Update files
Set read-only files {CUSFILE}

Multi-user prepare to insert. Prepares to insert a record in the current main file. Must be followed by an Update files command and the file must be in read/write mode.

$ctask.tData.$DeleteRecord()

Set main file {CUSFILE}
Find on CUSCODE (Exact match) {‘XXXXXX’}
If flag true
Do $ctask.tData.$DeleteRecord()
End If

Multi-user delete. Deletes the current record in the main file. There is no need to set the file to read/write mode.

$ctask.tData.$BuildCompList(pAssyPartNo, pAssyQty, pResultList, pIncludeNType, pIncludeBulk, pSort, pConsolidateByPart, pBuildLocationList, pLocationList, pCalculateCosts, pCostRow, pCostBulkNOnly)

Parameters:
pAssyPartNo = Part number of the assembly
pAssyQty = Quantity of the assembly
pResultList = The component list variable
pIncludeNType = kTrue if non-stock parts are to be included
pIncludeBulk = kTrue if bulk issue parts are to be included
pSort = kTrue if the list should be sorted by part number
pConsolidateByPart = kTrue if common parts are to be consolidated
pBuildLocationList = kTrue if a stock multi-location list is also to be built
pLocationList = The stock list variable
pCalculateCosts = kTrue if costs are to be calculated
pCostRow = The cost row variable
pCostBulkNOnly = kTrue if only the Non-stock type and bulk issue parts are to be costed

Builds a list of components for an assembly. pResultList must be predefined with a minimum of BOMFILE columns and will be populated by component part record values if it contains a PTMTYPE column. pLocations will only be populated if PTMMLOC and PTMTRAC are defined columns.

$ctask.tEnv.$Str(pStringCode, p1, p2, p3, p4, p5, p6)

Calculate #S1 as $ctask.tEnv.$Str(14265,$cdata.$pathname)

Returns an evaluated string from the String file Stings.stb

$ctask.tEnv.$Ok(pTitle, pIcon, pBell, pCancel, pStrNo, p1, p2, p3, p4, p5, p6)

Parameters:
pTitle = message title text or string number
pIcon = kTrue if an Icon should be shown
pBell = kTrue if the bell is to be sounded
pCancel = kTrue if a cancel button is to be included
pStringNo = message text or string number
p1 to p6 = message text parameters that will replace %1, to %6 in the text

Opens an OK message to the user and logs it in the Message List.

$ctask.tEnv.$No(pTitle, pIcon, pBell, pCancel, pStrNo, p1, p2, p3, p4, p5, p6)

Parameters:
pTitle = message title text or string number
pIcon = kTrue if an Icon should be shown
pBell = kTrue if the bell is to be sounded
pCancel = kTrue if a cancel button is to be included
pStringNo = message text or string number
p1 to p6 = message text parameters that will replace %1, to %6 in the text

Opens a No/Yes message to the user and logs it and the user response in the Message List. Sets the flag #F if the response is Yes.

$ctask.tEnv.$Yes(pTitle, pIcon, pBell, pCancel, pStrNo, p1, p2, p3, p4, p5, p6)

Parameters:
pTitle = message title text or string number
pIcon = kTrue if an Icon should be shown
pBell = kTrue if the bell is to be sounded
pCancel = kTrue if a cancel button is to be included
pStringNo = message text or string number
p1 to p6 = message text parameters that will replace %1, to %6 in the text

Opens a Yes/No message to the user and logs it and the user response in the Message List. Sets the flag #F if the response is Yes.

$ctask.tEnv.$GetExtremeChar()


Calculate m_SelCharA1 as $ctask.tEnv.$GetExtremeChar()

Returns the extreme character used in range searches.

$ctask.tEnv.$GetExtremeDate()


Calculate m_SelDate1 as $ctask.tEnv.$GetExtremeDate()

Returns the extreme short date used in range searches.

$ctask.tEnv.$GetExtremeDateTime()


Calculate m_SelDate1 as $ctask.tEnv.$GetExtremeDateTime()

Returns the extreme date time used in range searches.

Compiled in Program Version 5.10. Help data last modified 4 Jun 2012 04:47:00.00. Class wProgram last modified 10 Oct 2017 11:48:32.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

Get started.

Try our state-of-the-art ERP Manufacturing Software today.