You are here: LANSA for i User Guide > Appendix C. Technical Notes > Trigger Functions > Creating a Trigger Function

Creating a Trigger Function

To define a function as being a trigger function, use the TRIGGER parameter on the FUNCTION command.

If the function is to act as a data dictionary level trigger, enter *FIELD into the first part of the parameter, and the associated data dictionary field name into the second part of the parameter.

If the function is to act as a database level trigger, enter *FILE into the first part of the parameter, and the associated database file name into the second part of the parameter. The file specified must be a physical file.

As an aid to defining new trigger functions LANSA is shipped with the following Application Templates that can be used to form the base of a trigger function:

BBFLDTRIG

Field Level Trigger Function

BBFILTRIG

File Level Trigger Function

When a function is defined as a trigger function you must follow these guidelines:

When a function is defined as a trigger function you should follow these guidelines in most situations: