3 3 4 Field versus File Level Rules

Visual LANSA

3.3.4 Field versus File Level Rules

Field level rules and triggers will apply to every file that uses a specific field. In the Personnel System example, the DEPTMENT field is used in the Department (DEPTAB) and Employee (PSLMST) file. If a field level rule is defined so that DEPTMENT cannot be blank, then this rule applies to both the DEPTAB and PSLMST files. This field level rule will means that the Department code cannot be blank in the Department File and it cannot be blank in the Employee Master file. If Department code is allowed to be blank in Employee Master file, you cannot use a field level rule. You need to define the rule to the Department file only by using a file level rule.

You must be careful that the field level rule or trigger is truly a "global" rule to an application. Global means that the rule or trigger always applies to a specific field, no matter what file the field is used in.

It is recommended that most validations rules be specified at file level. File level validations rules allow you to control the context of a field. Also, if you have multiple validation rules for a single field, you are better able to control the order that rules are processed if all rules are at the same level. Finally, any changes to file level validation rules are automatically detected and the OAM will be rebuilt. You must use impact analysis to determine how a field level rule change will affect the database and you must manually rebuild OAMs for affected files. (Refer to Field Rules/Triggers and the Object Access Module.)

Before adding field rules and triggers, review File Rules and Triggers Development.

Ý 3.3 Field Rules and Triggers Development