Virtual Triggers is a utility for adding “scriptlets” to GP. A Scriptlet, or small script, is a small bit of dexterity which modifies the normal functionality of GP or adds new functionality. Virtual Triggers and Scriptlets can replace the need to create a separate dexterity customization when all that is needed are small tweaks to GP functionality.
For example, a Scriptlet could automatically mark checkboxes when a window opens or change labels on fields or hide fields without needing to modify a window. Since Virtual Trigger’s Scriptlets are dexterity, they are compatible with the GP Web Client.
Virtual Triggers is a dexterity development tool and is not intended for end-users. Creating Scriptlets requires advanced level experience with Dexterity (sanScript).
Contact WilloWare Support for the programming services to create Scriptlets.
Setup
Navigation: Tools >> Utilities >> System >> Virtual Triggers Setup
WilloWare will send Scriptlets in text files which can be imported into the Virtual Triggers Setup window.
IMPORT: Click the Import button, then select a Scriptlet file.
Click OPEN.
The Scriptlet will be read from the file, saved to the database, then displayed in the VT Setup window. If the Scriptlet already exists, you will be asked to confirm that you want to overwrite the existing Scriptlet.
DATABASE: the Scriptlet file will NOT contain Database IDs. The Scriptlet will only run in the database(s) selected here.
Click the DATABASES tab.
Mark the database(s) in which you want the Scriptlet to run. Click the Mark All or Unmark All buttons to select/de-select all databases.
Click the DATABASES tab to hide the window.
ACTIVE: by default the Scriptlet will be marked as ACTIVE. Unmark this box to disable it.
SAVE: click SAVE to save the Scriptlet and clear the window.
REFRESH TRIGGERS: after making any changes to Scriptlets, or importing new Scriptlets, clear the window then click the Refresh Triggers button. This will ensure your GP Client is running the current Scriptlets. Other users will need to log-out of GP, then log-in again to have the new Scriptlets activated.
IF YOU RECEIVE ANY WARNINGS DUING WHEN IMPORTING A SCRIPTLET, YOU MAY BE ATTEMPTING TO IMPORT AN OLDER SCRIPTLET FILE THAT THE UTILITY CANNOT READ. FOLLOW THE MANUAL ENTRY STEPS DESCRIBED BELOW.
To manually add a Scriptlet to your system, you will need to copy-paste information from the text file into the Virtual Trigger Setup window.
The top section of the text file contains the information needed for the top section of the window.
Copy the TRIGGER ID from the file and paste it into the Trigger ID field on the window.
Repeat for the Description and Product ID.
Mark the ACTIVE checkbox.
Enter one or more Databases in the Database list. The Scriptlet will only be active in the Companies you enter here.
The next section of the Scriptlet file contains the TRIGGER. Make sure that TRIGGER is selected in the View. Then copy the “trigger” section of the text file and paste it into the window, as shown above.
The final section of the Scriptlet file contains the SCRIPT. Make sure that SCRIPT is selected in the View. Then copy the “script” section of the text file and past it into the window, as shown above.
Click SAVE.
Click REFRESH TRIGGERS.
The Scriptlet is now active for the current user. Other users will need to close GP, then log-in again to activate the Scriptlets in their GP client.
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.
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.
Comments
0 comments
Article is closed for comments.