Step 3. Referential Integrity Rule in iiiEmployees File
REP007 - File Validation Rules/Triggers
In this step you will add a Lookup rule to the Employee file. This rule specifies that the Department field which is being inserted into the Employee file must exist in the Department file.
1. Open file iiiEmployees in the Editor.
2. On the
ribbon, expand the menu, to select the .
The simple rules list gives you an overview of all the rules in the file and indicates their type and whether a rule is defined in the field or file definition.
3. Select the iiiDeptCode field in the list of rules.
4. Select the
button on the ribbon and expand the menu to select to add the rule to the iiiDeptCode field.5. In the
tab, create the rule as follows:
|
Your
tab should now look like this:
6. Complete the
section, to define the actions to set the field in error if the value is not found:
|
Your
tab should now look like this:
7. Save the file.