Ø To set up Referential validation for a field
1. Referential Validation Type: Select Referential validation on the Integrity page’s Type combo box. VPM Enterprise transforms the Integrity page for Referential validation.
2. Parent RI Cursor: Use the Parent RI Cursor combo box to select the Reference table, view or CursorAdapter that you want to use for Referential Integrity.
Tip: The Parent RI Cursor is the table, view or CursorAdapter that contains the primary key whose values the foreign key is required to match.
Tip: If you also want to use your Parent RI Cursor entry for Field Validation, skip step 3 below. Normally, you will want to use the Parent RI Cursor for Field Validation also.
Tip – Views: After you set up a Referential Integrity definition for a foreign key in a table, you do not need to set up another Referential Integrity definition for the same foreign key in a local view based on the table. The local view will use the Referential Integrity definition of the table on which it is based. For a local view, you normally only need to set up Field Validation and Picklist Help definitions. However, you would want to set up Referential Integrity for a foreign key in a view (a) if you wanted VPME to enforce RI on remote data or (b) if you needed to speed up RI processing on a large table. Both of these topics are discussed in the section Referential Integrity for Foreign Keys in Views.
3. Validation Cursor: Use the Validation Cursor combo box to select the Validation table, view or CursorAdapter that you want to use for Field Validation.
Tip: The Validation Cursor is the table, view or CursorAdapter that contains the primary key values that are to serve as the domain of valid entries for the foreign key field.
Tip: If you want to use the Parent RI Cursor for Validation, do not make an entry in the Validation Cursor text box. If you do not identify a separate Validation Cursor, the Parent RI Cursor is used if it has been entered. Normally, you will want to use the Parent RI Cursor for Validation also.
Tip – Primary Key Field(s) Name: When you use a different Parent RI Cursor and Validation Cursor, the primary key field(s) in each cursor must have the same name.
Tip – Primary Key Tag: Make sure that you have identified the primary key tag of the Parent RI Cursor and Validation Cusor on the Edit page of the primary key tag in the Data Builder. See Index Tags and Toolbar Order Control.
Tip – Validation Views and CursorAdapters: If a view or CursorAdapter will be used as the Validation Cursor for a foreign key field that uses Referential Validation, the view or CursorAdapter needs to have a filter set on the primary key field or expression (if the primary key is compound) of the view or CursorAdapter using a variable named "PKValue". See View Filters and CursorAdapter Filters.
4. FK Tag: On the FK Tag combo box select the foreign key tag that links the foreign key to the primary key of the Parent RI Cursor and Validation Cursor.
Tip: The foreign key tag expression must not contain any other fields but the foreign key field(s).
Tip: The same foreign key tag must be able to link to each Cursor (Parent RI, Validation, and Picklist) you are using. To learn more about foreign key tags for tables, views and CursorAdapters, see 2. Child Table / Foreign Key Indexes:, 2. Child View / Foreign Key Indexes: and 2. Child CursorAdapter / Foreign Key Indexes:, respectively.
Tip – Create Tag: If you are setting up Referential Validation for a view or CursorAdapter and have not already created an index tag definition for the foreign key field, click the Create Tag button to have VPME automatically create the index tag definition for you. Then, select the new foreign key tag in the combo box.
5. Update Rule: In the Update Rule box click the option button for the update rule you want applied. See Updates - Updating the Primary Key for a description of the rules.
6. Delete Rule: In the Delete Rule box click the option button for the delete rule you want applied. See Deletes - Deletion of Primary Key for a description of the rules.
7. Picklist Builder: Use the Picklist Builder to set up Picklist Help. Because Picklist Help is such an important subject, it has its own chapter. See the following Building Data: Picklist Help chapter to learn how to set up Picklist Help and how to display Picklist Help from a form. See How to Use the Picklist Builder to learn how to use the Data Builder's Picklist Builder.
8. Option: Click the Options combo box to turn on validation for the field. Choose the validation option that you want for the field.
9. Override: If you want to allow users to override an entry that fails validation, check the Override check box.
Tip: If the foreign key is compound, check the Override check box or select “Record” as the Level(see “Compound Foreign Keys” below).
10. Level: Click the Level combo box to select when field validation should be run.
11. Save: When you leave the Integrity page for the field, VPM Enterprise will save your changes.