Configuring Shared Foreign Key Fields

Foreign key fields shared across group members and/or views must validate from the same table and field to ensure that queries retrieve correct data. You can manually configure validation for shared foreign keys in a Blueprint or mApp Solution.

If shared foreign key fields are not configured correctly, you receive validation warnings when you edit a foreign key field in a Blueprint or when you run the Foreign Key Configuration Health Check rule.

An example validation warning is: Foreign key field: Agreement.Supplier in view: (Default) requires field: OLA.Supplier in view: (Default) to be validated from a table

Good to Know

  • You can use the Foreign Key Configuration Health Check rule to return a list of all shared foreign key fields that are not configured correctly. See About Performance Health Check.
  • You can use the Foreign Key Administration dialog to automatically configure shared foreign keys. See Foreign Key Administration.
  • Standard foreign key rules also apply: shared foreign key fields must be validated from a table and validation must be enforced.
  • Constraints for shared foreign key fields can differ between group members and views.

To manually configure share foreign key fields:

  1. Create a Blueprint.
  2. Examine the validation settings for the first field referenced in the warning. For the warning above, for example, examine the Supplier field in the Agreement table. Note that the field is validated from the Supplier Name field in the Supplier table.

    Validate from Supplier table check box selected

  3. For the warning above, examine the Supplier field in the OLA group member table. In this case, the Supplier field in the OLA table is not validated by a table. (In other cases, the validation tables and fields may not be identical for the shared foreign key fields, and they must be.)

    OLA supplier field Validate from table check box selected

  4. Select the Validate from Table check box, and then:
    1. From the Table list, select Supplier.
    2. From the Field list, select Supplier Name.
    3. Select the Validation is Enforced check box.

      If you are configuring foreign key fields that were previously applied as part of a Protected mApp™ Solution:

      • When you upgrade the Business Object, the foreign key is overwritten by the value from the Protected mApp Solution.
      • You see a message saying
        "Before applying a foreign key, ensure 'Validate from table' is selected and enforced. Fields that store foreign keys may need a Relationship defined to search if duplicate values exist. Use an existing Relationship or create a new one."
      • If you don't select Validation is enforced, you cannot make changes to foreign key settings.
    4. Select Sync to synchronize the validation settings for matching tables for a set of shared foreign key fields. For example, the settings applied for the OLA Supplier field would be made to the Supplier field for all members for the Agreements group.

    Vlaidation is enforced check box selected

  5. Select OK.
  6. Publish the Blueprint.

    Verify changes before publishing the Blueprint to a production environment.