Trigger scripts

The triggers.g form contains a field for entering JavaScript (Script). We recommend that the Script field contain single statements that invoke functions in the ScriptLibrary. For example, system.library.myTriggers.triggerXYZ( );.

Click the Compile icon in the ScriptLibrary to verify the syntax of your trigger script function. A trigger script only needs to return a value if the trigger fails. The user can indicate the failure of a trigger by returning the value of –1. Trigger scripts can access the value of the current record in memory using the global object called system.record, and they can access the value of the same record on disk using the global object called system.oldrecord. For example, system.library.myTriggers.triggerXYZ( system.record, system.oldrecord );.