Question

Database Relations

How can I define the relations (1:1, M:M :1:M) between two Data Model objects (Tables)?

Like 0

Like

1 comments

Hello!
In Creatio, the relations between Data Model objects (tables) can be configured in the following ways:

1. One-to-Many (1:M)

  • Add a lookup column in the “child” object that references the “parent” object.
  • On the parent object’s page, add a detail that displays related child records filtered by this lookup.

This is the most common relation type in Creatio.

2. One-to-One (1:1)

  • Create a lookup column in object B referencing object A, and add a unique index on that column (so one A record can only have one B).
  • Alternatively, you can use the same Id as the primary key in both objects, establishing a strict 1:1 relation.

Use this type if each record in one table should correspond to exactly one record in the other.

3. Many-to-Many (M:M)

  • Create a link object that contains two lookup columns: one referencing object A and one referencing object B.
  • Add a composite unique index on both columns to avoid duplicates.

Configure details on A and B pages to show related records through the link object.

 

Best practices:

  • Use clear naming conventions for lookup columns and link objects (e.g., A_B_Link).
  • Always add indexes on lookup columns and composite keys in link objects.
  • For 1:1 relations, ensure database uniqueness is enforced.
  • Add details to the UI so users can easily navigate related records ( for #1 and #2 relations).
Show all comments