Example: Defining a Foreign Key Relationship for Asset Status Field
This example explains how to configure a foreign key relationship for the Asset Status Field in the Configuration Item Group Leader.
The example assumes that the Asset Status Field is validated using the Status Field in the CI Status Lookup Table and uses CI Type as a constraint. By adding a foreign key relationship to the Asset Status Field, you ensure that values are correctly stored for the Field when it is used by Group Members.
Example: Defining the Foreign Key Relationship
To define a foreign key relationship for the Asset Status Field:
- Create a Blueprint.
- From the Object Manager, select the Configuration Item (CI) Group Leader, and then click Edit Group.
- Open the Status Field to the Validation/Auto-populate page.
- Select the Store foreign key check box.
- Click Create.
The foreign key relationship that links Configuration Item to the Lookup Table CI Status is created.
- Click OK.
Example: Creating Unique Lookup Values
In some cases, duplicate values may exist in the Lookup Table used in your foreign key relationship. You must create a new table to store unique values that can be correctly referenced as foreign keys.
In this example, you will create a new Lookup Table to consolidate duplicate Status Field values in the CI Statuses Lookup Table.
To consolidate duplicate CI Status Field values:
- From the Object Manager, select Lookup Tables, and then select the CI Status Lookup Table.
- Select Edit Data.
- Make note of the duplicate values in the Status Field. In this example, you may see these values:
- In Repair
- In Stock
- In Testing
- Close the Data Editor, and then create a new Lookup Table. For this example, use the name Status Value.
- Click OK.
- Add a Status Field to the new table, and then add the Status Field to the table's Default Form.
- Return to the Object Manager, and then open the Data Editor.
- Add a single value for each duplicate value found in step 4.
- Close the Data Editor.
Example: Setting Validation for the Foreign Key Relationship
After you create a Lookup Table that stores unique values for your foreign key relationship, you must enable validation on the Field used as part of the relationship.
In this example, you would set the Status Field in the CI Status Lookup Table to validate from the Status Field in the newly created Status Value Lookup Table.
The Field used in the foreign key relationship must also store foreign keys.