4 5 3 Rule Hierarchy

Visual LANSA

4.5.3 Rule Hierarchy

Rules and triggers exist in a 3 level hierarchy:

 

                        FIELD LEVEL

                             |

                             |

                             |

                         FILE 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 FILE1, FILE2 and FILE3, all files will have the same rule applied.
  • File level rules/triggers apply only to the field within the file. For instance, FILE1 may have a rule that says field DATDUE must be in the format DDMMYY, however FILE2 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 file level checks associated with file FILE1.

Almost all validations will be specified at file 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 File Level Rules.)

Also See

4.5.1 Rule Concepts

4.5.4 Understanding Rule Sequence

Ý 4.5 File Rules & Triggers Development