Step 7 Know about File Level Triggers

Visual LANSA

Step 7. Know about File Level Triggers

REP007 - File Validation Rules/Triggers

A database trigger is a condition that is defined for a field or file in the repository. Typically triggers are used to move complex logic to the file definition.  The trigger definition links a trigger function to a specific database operation and condition. This function is invoked automatically when a specific type of I/O operation occurs to a file and when a specific set of conditions are met.

Similar to validation checks, LANSA triggers centralize the business logic of your application. 

A LANSA trigger function is a special type of LANSA function, which is invoked automatically when a specific type of I/O operation occurs on a file (Open, Close, Read, Insert, Update and Delete) and when a specific set of conditions are met.

For example, as an audit trail, you might create a trigger to print before and after recording specific values.

Triggers are not covered in this tutorial because you need to write code in order to create a trigger function.