Define the Keys of a Modeled Entity

Each modeled entity must have a primary key.

At least one field must be defined in the modeled entity.

For a database entity, the primary key is used to uniquely identify each record in the database, and for use in relationships between entities. Even non-database entities need a primary key to ensure that they can be correctly compiled when used in a component.

  1. Open the entity and go to the Define Keys/Indexes worksheet.

    The Key Editor shows the entity object and the primary key object, which is always named number 1.

  2. In the Resource Browser, select one or more fields that should make up the primary key, and drag them and drop them onto the key object.

    Primary Key of ORDERLINE.SALES

    Key Editor showing Primary Key of ORDERLINE.SALES

    Tip: You can filter the list of available fields in the Resource Browser by starting to type a field name or keyword in its U-Bar.

  3. To create a candidate key or index

    1. Right-click the entity and choose Create Key from the context menu.
    2. Modify the Key Type field to choose Candidate or Index (the default).
    3. Select one or more fields in the Resource Browser and drag them and drop them onto the key object.

After the keys are defined, it is possible to create relationships between entities. For more information, see Define Relationships Between Modeled Entities.