Adding record scripts to record types

You can add a record script to a record type from the Record Scripts folder in the Schema Repository Designer or with the Record Actions grid.

About this task

To add a record script with the Actions grid, see Adding actions.

Procedure

To add a record script through the Record Scripts folder:
  1. Start the Designer.
  2. In the Schema Repository Explorer view, expand the Record Types node and then expand the desired record type.
  3. Expand the Record Scripts folder.
  4. 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.
  5. Type a name for the record script.
  6. Double-click the new record script name to star the Script editor.
  7. Edit the record script. Type your code in place of this line:
    REM added your hook code here
    
  8. When you are finished editing your code, click Hooks > Compile to catch any syntactical errors. When you compile your script, your code is saved.
  9. 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. The following is an example of the Visual Basic hook 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.