Alternative Keys for Related Objects

Previous Next

See Also

Parent database objects are represented in their child objects with a foreign key. Often, values in these columns are ID numbers that have no meaning to the end user. The parent object may have an alternative key, which the end user understands better, such as the combination of First Name, Last Name and Date of Birth identifying individual persons. In this case, you may want to show this alternative key in the windows and info boxes for the child object, perhaps instead of the numerical foreign key itself.

To achieve this, do not use extra queries in the Windows Designer. In USoft Definer, create a joined column for each of the fields of the alternative key. Set the Displayed attribute of the foreign key column to Off (by clearing the check box).

CAUTION:

Do not make the foreign key undisplayed unless you are sure that the combination of joined columns is a true secondary key, i.e. uniquely identifies each parent object.

NOTE:

Be aware that USoft Developer refers to records in database objects with their primary key value if it issues error messages in the transaction window when database constraints have been violated. If you represent a parent object in its child object with an alternative key and hide its real foreign key, the end user may not understand to which record in the parent object USoft Developer refers when it reports the violation.