Referential Validation

Tip – Very Important: This "Referential Validation" section is one of the most important sections in all the VPM Enterprise documentation. Important VPME functionality depends on a correct set up of Referential Validation for the foreign keys in your data. Be sure to read this section carefully and thoroughly.

You use the Field - Integrity page in the Data Builder to set up Referential Validation for all the foreign keys in your application's tables, views and CursorAdapters. When you select the Referential validation type for a foreign key field, the Integrity page looks like this:

When you use the Integrity page to set up Referential Validation for a foreign key field, you can set up the following three definitions for the field:

1.   Referential Integrity Definition: You define a Referential Integrity (RI) relationship between the foreign key field and the primary key of another table, view or CursorAdapter. Then, you select the RI Update and Delete Rules to use. Your RI definition determines what happens to the foreign key when the primary key is updated or deleted. Your RI definition is also used to link tables, views and CursorAdapters for VPM's Related Forms functionality (which includes Related Pages and One-To-Many forms).

2.   Field Validation Definition: You identify the table, view or CursorAdapter whose primary key values are to serve as the domain of valid entries for the foreign key field.

3.   Picklist Help Definition: Using the Picklist Builder, you define the field’s Picklist Help and create the Picklist grid for the foreign key field. Picklist Help in a VPME application displays a list of valid entries for the foreign key field when an application user is entering a value in the field on a form. The valid entries are the primary key values found in another table, view or CursorAdapter. 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.

Normally, you set up all three definitions for a foreign key field, but you don't have to do that. For example, you can skip setting up the Referential Integrity and Picklist Help definitions if in a particular situation you find that you don't need Referential Integrity (or Related Forms) or Picklist Help for a foreign key field.

Tip: A key to setting up each of the three definitions is the selection of the table, view or CursorAdapter whose primary key values are to be used for Referential Integrity, Field Validation and Picklist Help. Most of the time, you will use the same table, view or CursorAdapter for all three purposes. However, the VPME Data Builder allows you to use a different table, view or CursorAdapter for each one, as described below. See Using Different Reference, Validation & Picklist Tables/Views/CursorAdapters for examples.

More:

Referential Validation Setup - Overview

Referential Validation Setup - Details

Compound Foreign Keys

Bypass RI

Referential Integrity for Foreign Keys in Views

Table, View and CursorAdapter Relations

Special Situation Regarding Numeric Foreign Keys

Using Different Reference, Validation & Picklist Tables/Views/CursorAdapters

Filter Expression