Summary

 Validation and Verification Rules describe tests that are applied to data to determine if the data is acceptable. In this article, I describe:

  • The difference between Validation and Verification Rules.
  • How to interpret the results of the tests.
  • Some examples of how to apply Validation and Verification Rules.

Applicability

Validation and Verification rules are applied to Data that is either being entered by a User or is being retrieved for use.

Validation Rules

Validation rules are applied to a single field to determine if the entry is acceptable.

  • There must be one or more specific tests that are applied in order to determine if the data in the field is acceptable or not.
  • The tests may be simple, such as evaluating the length of the field, or may require a calculation on the entry to determine if it is acceptable.
  • There may be multiple tests applied to the entry in the field.
    • If the results of all of the tests are acceptable, then the entry in the field is acceptable.
    • If the result from one or more tests are not acceptable, then the entry in the field is not acceptable.
  • Validation rules are normally applied when there is a change in the entry of a field, such as when data is entered or removed from a field.

Verification Rules

Verification rules are applied to multiple fields to determine if the combination of entries in those fields is acceptable.

  • There must be one or more specific tests that are applied in order to determine if the combination of the data in the fields is acceptable or not.
  • The tests may be simple, such as verifying that all of the fields included in the combination are valid, or may require that if there is valid data in one field, then a second field in the combination must be empty.
  • There may be multiple tests applied to the combinations of fields.
    • If the results of all of the tests are acceptable, then the combination of entries in the fields is acceptable.
    • If the result from one or more tests are not acceptable, then the combination of entries in the fields is not acceptable.
  • Verification rules may be applied when:
    • There is a change in the entry for one of the fields that is included in the combination.
    • When data is being retrieved.
    • Prior to saving the entries for the fields included in the combination.

Possible Values

In my experience there are three possible results from applying these rules:

  • Null:
    • For a validation rule, this would be the result when there is no entry in the field.
    • For a verification rule, this would be the result when there is no entry in any field that is included.
  • True
    • For a validation rule, this would be the result when there is an entry in the field and the results of all validation tests are acceptable.
    • For a verification rule, this would be the result when the combination of fields included in the rule and the results from all verification tests are acceptable.
  • False
    • For a validation rule, this would be the result when there is an entry in the field and at least one result from a validation test is not acceptable.
    • For a verification rule, this would be the result when the combination of fields included in the rule and at least one result from a verification test is not acceptable.

 Examples of Validation and Verification Rules