Adding a foreign key constraint to a table definition

The column linked to a foreign key constraint must have the same SQL Type and length as the column the constraint is linked to.

Note: Infor Public Sector automatically adds an index for each foreign key constraint that you add.
  1. Select System > Agency Personalization > Schema Manager.
  2. In the Enhancement Product Families tree, browse to the Constraints node for the table definition that you want to add the foreign key constraint to.
  3. Click the Constraints node.
  4. Click Add above the grid.
    The Add Constraint dialog box is displayed with ForeignKey displayed as the default constraint type. If it is not selected, select it now. The name is automatically displayed as FK_[TABLENAME]_ and the Common ID is displayed as [TableName]??. Both of these names follow an Infor Public Sector naming scheme that is meant to ensure consistency.
  5. In the Name field, type additional information to the right of the name to uniquely identify this foreign key constraint.
    Infor Public Sector automatically begins the name of every foreign key constraint with FK_[TABLENAME]_. This information is repeated for every foreign key constraint you add, so constraints in the same table will have the same name. To ensure consistency and uniqueness, you must add other information to the name, such as the name of the column that the constraint is for. You can also completely replace the name with a unique one devised from your own naming scheme.
  6. In the Common ID field, replace the ?? with additional information to further identify the constraint.
    Infor Public Sector automatically begins the common ID of every foreign key constraint with [TableName]??. Replacing the ?? with additional information ensures that the common ID is unique. You can also completely replace the common ID with a unique one devised from your own naming scheme.
  7. Type a description of the foreign key constraint in the Description field.
    Descriptions, such as Foreign key for [TABLE_NAME] on [COLUMN_NAME], can help you identify the purpose of the constraint. The information you type should be helpful to anyone who will be setting up and maintaining Infor Public Sector.
  8. In the One 'linked table' record must have_'parent table' record(s) list, select the relationship between the table the foreign key points to and the table the constraint is for.
  9. In the One 'parent table' record must have_'linked table' record(s) list, select the relationship between the table the constraint is for and the table the foreign key points to.
  10. Specify any other information about the foreign key constraint.
  11. Link a column to the constraint.
    Linking a column to a constraint tells Infor Public Sector which column the constraint applies to. Without this link, the constraint is useless. If the column for the foreign key constraint does not have the same SQL type and length as the column, Infor Public Sector will not add the link.

    See Linking a column to a foreign key constraint.

  12. Click Save.
    Infor Public Sector assigns a key value to the constraint and adds the constraint to the table definition. The new constraint is displayed in the Constraints grid. Note that changing or deleting an existing constraint will cause errors wherever it has already been used. If you change or delete a constraint, you must update any references to it throughout your system.