Rule Hierarchy
Rules and triggers exist in a 3 level hierarchy:
FIELD LEVEL
|
|
|
TABLE LEVEL
|
|
|
PROGRAM LEVEL
- Field level rules/triggers always apply to a field under all circumstances. For instance, a field level rule that says a post code must be in the range 2000 to 2999 will ensure that no matter when or how the post code field is used it will ALWAYS have to be in the range 2000 to 2999. If post code is used in TABLE1, TABLE2 and TABLE3, all tables will have the same rule applied.
- Table level rules/triggers apply only to the field within the table. For instance, TABLE1 may have a rule that says field DATDUE must be in the format DDMMYY, however TABLE2 may have a check that says field DATDUE must be in the format YYMMDD. This may be perfectly valid.
- Program level rules apply only to the field as used within a program (Function or Component). For instance, a Function named ORDERS may add the rule that field DATDUE (used in previous example) must be within the next 30 days. This check will be done in addition to the table level checks associated with table TABLE1.
Almost all validations will be specified at table level. Field level validations apply everywhere a field is used so you must be careful that the rule is truly a "global" rule to an application. (Refer to Field versus Table Level Rules.)
Also See
Rule Concepts
Understanding Rule Sequence