Adding field hooks

You can add field hooks to customize the behavior of fields by providing such features as choice-lists, field validation, default values, and permissions.

Before you begin

If you add a permission hook to a field, you must adjust the values for that field in the Behaviors grid. The permission hook does not work unless the field behavior is set to USE_HOOK.

Procedure

To add a field hook:

  1. In the Schema Repository Explorer, expand the Record Types folder in your schema and then double-click on a record type. The record type editor opens.
  2. Click the Fields tab to view the Record Fields grid. The Record Fields grid contains a column for each type of predefined field hook.
  3. Click in the hook column for the desired field, click the down arrow, and then select Scripts > Add Basic Script or Scripts > Add Perl Script. If Instant Editing Mode is enabled, the appropriate script editor starts. If Instant Editing Mode is disabled, you must double-click the cell to start the editor.

    The editor that starts depends on the type of hook that you select. For example, if you click SCRIPTS > BASIC, the Basic Script editor starts. If you choose CONSTANT LIST, the Choice List window opens.

  4. Edit the hook. If you are not editing a global script, note that you can only add text between the # Start User Code and # End User Code tags. Any text entered outside of these tags will not be saved. The calling syntax for the hook is added to the script and cannot be edited.