How to Define a Trigger

If the trigger is defined for a field, this simply means that any table with a column based on the field implements the field's trigger functionality.

When the trigger is defined for a column within a table, it applies to this table only.

Trigger Function

A suitable trigger function should first be created using the supplied template. The template provides the required logic for all I/O operations, to which you add your own logic.

Full details are provided here: Creating a Trigger Function.

Define a Trigger for a Table Column

Open a table in the editor and select the Rules and Triggers tab. Select the relevant column and add a trigger using the Details tab to define the trigger function and the trigger point. You can then optionally define one or more trigger conditions. For example:

 

The trigger condition supports special operators such as Not Equal Previous (NEP).

For full information, see Trigger Functions in the LANSA for i User Guide, including examples.