4 5 8 Trigger Conditions If

Visual LANSA

4.5.8 Trigger Conditions - If

The use of a trigger condition is optional in LANSA.  Trigger conditions provide fine grain event control so that a trigger is not always being called only to do nothing.  For example, you may specify that a trigger is called only if an Employee's salary is greater than 100,000.

If you do not specify a condition, the trigger will be invoked unconditionally, that is every time the trigger points are reached. Using trigger conditions will greatly improve the performance of the application as the trigger is only called when it is needed.

If the trigger is defined at the field level, the trigger conditions can only involve the field to which the trigger is linked. If the trigger is defined at the file level, the trigger conditions can involve any other real or virtual field from the file being used.

Possible operations are GT, GE, LT, LE, EQ, NE and REF. 

Note: The operation codes may have a suffix 'P', which indicates that the Previous value of the nominated field should be used.  The value of a previous field can only be used in 'Update' operations. REF (Refers to) is only allowed on 'Read', 'Insert' and 'Update' operations.

There are no conditions allowed for Open and Close triggers.

Also See

Trigger Condition in the Technical Reference Guide

Ý 4.5 File Rules & Triggers Development