You can add a record script to a record type through the Record
Scripts folder or Actions grid.
About this task
To add a record script
through the Actions grid, see
Adding actions.
To add a record script through the Record Scripts folder:
Procedure
- Start the Designer.
- In the Workspace, expand Record Types, and
expand the desired record type.
- Expand the Record Scripts folder.
- Right-click the language folder and click Add. The Designer adds a script to the folder; the name is highlighted
so that you can change it.
- Type a name for the record script.
- Double-click the new record script name to star the Script editor.
- Edit the record script. Type your code in place of this line:
REM added your hook code here
- When you are finished editing your code, click to catch any syntactical errors.
When you compile your script, your code is saved.
- Close the Script Editor window.
Results
For each record script you define, the Script editor creates a stub
that includes the record name, hook name, and required syntax. Each hook has
the following format:
Function RecordName_HookName(param)
' param as EventObject
REM Your code here
End Function
The parameter passed to a record script is an instance of the
EventObject class. This instance contains information about the event that
triggered the call to the hook. It contains the type of the event, the control
that invoked it, and additional information depending on the type of event.
For more information, see Record scripts.