Commands
Virtual Triggers Scriptlets supports all Dexterity (sanScript) commands and Function Library commands. In addition, the following Commands are provided by language extensions in the Virtual Trigger module.
CompanyID
Purpose
Retrieve the Company ID (database ID) for the current company. Use this when working in 3rd party dictionaries because ‘Intercompany ID’ of globals will not be available from within the 3rd party.
Syntax
call with name “CompanyID of form wwSQL” in dictionary 4600, sDB;
Parameters
- Returns string – Database ID (i.e. TWO for Fabrikam).
Exec
Purpose
Execute a pass-through tSql statement.
Syntax
call with name “Exec of form wwSQL” in dictionary 4600, Database, SQL Statement, Suppress Errors, Error Message;
Parameters
- Database – if left blank (“”) it will default to the current database (‘Intercompany ID’ of globals).
- SQL Statement – a text parameter containing the tSql statement to execute.
- Suppress Errors – a Boolean (true/false) that controls whether an error message dialog box will display.
- Error Message – a string identifying the Scriptlet, such as the Trigger ID or Trigger Description. If the SQL statement generates an error the Exec command will display the SQL Error, the Error Message provides more information about what code generated the error.
Exists
Purpose
Execute a pass-through tSql statement that has a true/false return. This is commonly used to see if a certain record or condition exists in the database.
Syntax
call with name “Exists of form wwSQL” in dictionary 4600, Database, SQL Statement, Error Message, Exists;
Parameters
- Database – if left blank (“”) it will default to the current database (‘Intercompany ID’ of globals).
- SQL Statement – a text parameter containing the tSql statement to execute.
- Error Message – a string identifying the Scriptlet, such as the Trigger ID or Trigger Description. If the SQL statement generates an error the Exec command will display the SQL Error, the Error Message provides more information about what code generated the error.
- Exists – a Boolean return parameter.
GetAcct
Purpose
Retrieve a GL Account stored using SaveAcct.
Syntax
call with name “GetAcct” in dictionary 4600, Array Number, Account Number;
Parameters
- Array Number – in integer from 1 to 20.
- Account Number – an account number field.
GetDate
Purpose
Retrieve a date stored using SaveDate.
Syntax
call with name “GetDate” in dictionary 4600, Array Number, Date;
Parameters
- Array Number – in integer from 1 to 20.
- Date – a Date field.
GetDlr
Purpose
Retrieve a currency/dollar amount stored using SaveDlr.
Syntax
call with name “GetDlr” in dictionary 4600, Array Number, Dollar;
Parameters
- Array Number – in integer from 1 to 20.
- Dollar – a currency/variable currency/dollar/quantity field.
GetInt
Purpose
Retrieve a longer integer amount stored using SaveInt.
Syntax
call with name “GetInt” in dictionary 4600, Array Number, LongInt;
Parameters
- Array Number – in integer from 1 to 20.
- LongInt – a long integer or integer field.
GetStr
Purpose
Retrieve a string value stored using SaveStr.
Syntax
call with name “GetStr” in dictionary 4600, Array Number, String;
Parameters
- Array Number – in integer from 1 to 20.
- String – a string field up to 255 characters.
SaveAcct
Purpose
Save a GL Account Number for use by another Scriptlet. Use GetAcct to retrieve it.
Syntax
call with name “SaveAcct” in dictionary 4600, Array Number, Account Number;
Parameters
- Array Number – in integer from 1 to 20. Keep track on the array number used as that same array number must be used in GetAcct to retrieve the value.
- Account Number – an account number field.
SaveDate
Purpose
Save a Date for use by another Scriptlet. Use GetDate to retrieve it.
Syntax
call with name “SaveDate” in dictionary 4600, Array Number, Date;
Parameters
- Array Number – in integer from 1 to 20. Keep track on the array number used as that same array number must be used in GetDate to retrieve the value.
- Date – a date field.
SaveDlr
Purpose
Save a dollar/currency/variable currency for use by another Scriptlet. Use GetDlr to retrieve it.
Syntax
call with name “SaveDlr” in dictionary 4600, Array Number, Dollar;
Parameters
- Array Number – in integer from 1 to 20. Keep track on the array number used as that same array number must be used in GetDlr to retrieve the value.
- Dollar – a currency/dollar/variable currency field.
SaveInt
Purpose
Save a long integer for use by another Scriptlet. Use GetInt to retrieve it.
Syntax
call with name “SaveInt” in dictionary 4600, Array Number, LongInt;
Parameters
- Array Number – in integer from 1 to 20. Keep track on the array number used as that same array number must be used in GetInt to retrieve the value.
- LongInt – a long integer or integer
SaveStr
Purpose
Save a string value for use by another Scriptlet. Use GetStr to retrieve it.
Syntax
call with name “SaveStr” in dictionary 4600, Array Number, String;
Parameters
- Array Number – in integer from 1 to 20. Keep track on the array number used as that same array number must be used in GetStr to retrieve the value.
- String – a string field up to 255 characters.