Field versus Table Level Rules

Field level rules and triggers will apply to every table that uses a specific field. In the Personnel System example, the DEPTMENT field is used in the Department (DEPTAB) and Employee (PSLMST) table. If a field level rule is defined so that DEPTMENT cannot be blank, then this rule applies to both the DEPTAB and PSLMST tables. This field level rule will means that the Department Code cannot be blank in the Department table and it cannot be blank in the Employee Master table. If Department Code is allowed to be blank in Employee Master table, you cannot use a field level rule. You need to define the rule to the Department table only by using a table 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 table the field is used in.

It is recommended that most validations rules be specified at table level. Table 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 table 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 tables. (Refer to Field Rules/Triggers and the Object Access Module.)

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