Relations between modules
Link one module to another (belongs to, has many, many to many, has one or parent), make a link required, and choose what happens to linked records on delete.
- Who can use this
- Account owner, Manager
Link one module to another (belongs to, has many, many to many, has one or parent), make a link required, and choose what happens to linked records on delete.
A relation links the records of two modules: each invoice belongs to a customer, an order has many line items, a project has many members and each member is on many projects. (Admin screens call modules entities; this help center says module.) Relations let people pick linked records, show related lists on a record, and let formulas and rollups read across modules.
Sidebar → Admin → Entity Manager, open the module, then the Relations tab. Each relation shows its name, its target module and badges: Cascade Delete, Required and Inverse. "No relations defined" means the module has none yet.
| Relation Type | Meaning | Example |
|---|---|---|
| Belongs To | Each record of this module links to one record of the target (many-to-one). | An invoice belongs to one customer. |
| Has Many | One record here has many records in the target (one-to-many). | A customer has many invoices. |
| Many to Many | Records on both sides link to many on the other. | Projects and team members. |
| Has One | One record here has exactly one in the target (one-to-one). | An employee has one contract. |
| Belongs To Parent | A parent in a hierarchy. | A sub-task belongs to its parent task. |
The field types Link (BelongsTo), Link (Many) and Link (Parent) create the same kinds of link from the Fields tab; see Field types.
You can also describe it in the AI box, for example "belongs to Account" or "has many LineItems", and AI fills in the form.
Display Label is what people see (for example "Parent Company"). Link Name is the internal identifier (for example parentCompany): letters, digits and underscores, starting with a letter or underscore. Leave it blank to fill it from the label. It cannot change after creation.
This creates the reverse list on the target module, for example invoices on Customer for an invoice that belongs to a customer. On the target, the reverse relation shows the Inverse badge and a Manage on … link back here.
See the table below.
You see "Relation created".
| Setting | What it does |
|---|---|
| Cascade Delete | "Delete related records when this record is deleted". It works from the "one" side: on a Has Many relation, or on a Belongs To relation that has a Foreign Name, deleting the parent sends its linked records to the recycle bin. |
| Required | "A record can't be saved without this link, and it can't be cleared later." Only on Belongs To, Has One and Belongs To Parent. |
| Sort Order | The order of the relation among the module's relations. |
After creation you can change the Display Label, Foreign Name, Cascade Delete, Required (where the type allows it) and Sort Order ("Relation updated"). The link name, type and target are fixed: "Update relation properties. Name and type cannot be changed." To change them, create a new relation.
This applies to the records on the "many" side of a Has Many relation, or of a Belongs To relation that has a Foreign Name, when their parent is deleted.
| Situation | What happens to the linked records |
|---|---|
| Cascade Delete on | They go to the recycle bin too. Restoring the parent can bring them back. |
| Cascade Delete off | They stay, and their link to the deleted record is cleared. If you restore the parent, they are linked again. |
| Many to Many | Never cascades; only the links are removed. |
| A linked record is protected by a Prevent Delete rule | The whole delete is refused. |
| The cascade would reach too many records or levels | The whole delete is refused. Delete the linked records in smaller batches first. |
Click Delete on the relation and confirm "Delete relation "…"?". You see "Relation deleted". Lookup fields, rollups, formulas, layouts and reports that used the relation may stop working, so check them.
customer.country, and total related records with a Rollup field.| Message or symptom | Why | What to do |
|---|---|---|
| "A relation named "…" already exists on module. Pick a different name." | The link name is taken. | Choose another name. |
| "Letters, digits, and underscores only — must start with a letter or underscore." | The link name breaks the naming rules. | Rename it. |
| A message that "required" applies only to some relations | Required was set on a Has Many or Many to Many relation. | Make the link required on a Belongs To, Has One or Belongs To Parent relation. |
| "Delete cascades deeper than 10 levels…" or "Delete would affect more than 10000 related records…" | Deleting the record would also delete too many linked records. | Delete the linked records in smaller batches first. |
| ""…" is in the trash and still holds the links of relation "…"…" | A module in the trash still holds the name. | Restore it, delete it permanently, or choose another name. |
| A record can't be saved without a link | The relation is Required. | Pick the linked record. |