2.13 Triggers
This display results when:
- An existing trigger has been chosen for review.
- A new trigger is to be added
|
Note that file name is only displayed when working at file level. Change and Delete command keys are only enabled when displaying an existing check.
If an existing trigger is being reviewed then the CHANGE key can be used to place the screen in change mode and the required changes made.
If an existing trigger is being reviewed then the DELETE key can be used to delete the trigger. Note that the delete is immediate. No confirmation is required.
If a new trigger is being added then the screen will be presented initially with default values. Change as required and press Enter to complete specification of the trigger.
Input Options
These input options apply to a trigger:
Order to Process
Mandatory, but always prefilled to <highest order number + 10>. Triggers are performed (and displayed) in the sequence of these order numbers (within the trigger level). Order numbers must be unique within the trigger level.
For instance:
|
would be performed: TRIG04, TRIG01, TRIG02, TRIG05, TRIG03.
Source
Output field. Indicates the source or level at which the trigger applies.
User Description of Trigger
Mandatory. Enter a brief description of the trigger to aid other users in understanding its purpose.
Trigger Function Name
Mandatory. Enter the name of the trigger function which will be called when the trigger conditions are satisfied. The named function must be defined with the TRIGGER parameter on the FUNCTION command. (Refer to the FUNCTION command in the for details).
Trigger Points
At least one point where the function is to be triggered must be entered (by entering a "Y" at the required point).
Trigger When
Optional. If no test conditions are specified the trigger will be unconditionally invoked.
Rules for entering conditions are as follows:
- Operations allowed are:
GT |
Greater than |
GE |
Greater than or equal to |
LT |
Less than |
LE |
Less than or equal to |
EQ |
Equal to |
NE |
Not equal to |
REF |
Refers to |
- All operation codes can be suffixed by a "P" indicating that the previous value of the nominated field should be used. Such conditions are only valid for "Update" operations. Also Part 2 of the condition must not be a literal if this type of operation code is used.
- No conditions are allowed if "Open" or "Close" are used.
- The "REF" operation code is only valid for "Insert", "Update" and "Read" operations.
- If the trigger is defined at dictionary level, the conditions can only involve the field to which the trigger is being linked.
- If the trigger is defined at the file level, the conditions can involve any other real or virtual fields in the file to which the trigger is being linked.
Examples
Trigger field:
|
Trigger function:
|
Refer to Trigger Functions for full details and examples