A Salesforce org is, at its core, a relational database wrapped in a metadata-driven application platform. The objects exposed in Object Manager are tables; the records inside them are rows; the fields are columns; and the relationships are the foreign keys that bind one object to another. Where the platform departs from a vanilla relational database is that every relationship simultaneously carries semantic meaning for sharing, ownership, reporting, automation, and user interface assembly. Choosing the wrong relationship type is therefore not a cosmetic mistake but a structural one that will be felt by every downstream feature: sharing rules will fail to cascade, roll-up summaries will be unavailable, deletion will produce orphans, and reports will not join the rows the business expects. An administrator's job in this section is to translate a business statement of the form "an order has many line items and each line item belongs to exactly one order" into the correct selection from the platform's relationship catalog.
The starting point is the distinction between standard objects and custom objects. Standard objects are shipped by Salesforce, ship with a predefined API name (no suffix), and cannot be deleted; their fields, however, can be extended with custom fields and their behavior can be altered with record types, validation rules, and page layouts. Account, Contact, Opportunity, Lead, Case, Campaign, Product2, Pricebook2, Order, Asset, Contract, Task, Event, and User are the most-tested standard objects on the administrator exam. Custom objects are created by the administrator from Object Manager and receive the __c suffix on their API name, a separate set of physical tabs, optional reports, search visibility, and activity tracking flags. An administrator can also flip activity tracking, field history tracking, and the Allow Reports flag at object creation; the Allow Reports flag in particular is irreversible-by-policy in user-facing terms because turning it off after reports already exist breaks those reports. Standard objects already have the major flags set appropriately; custom objects ship with the flags that the creator picks at the moment the object is saved.
Once two objects exist, the administrator binds them with a relationship field placed on the child side. The field type chosen there decides the entire ownership model. The choices are: lookup, master-detail, many-to-many (a pattern, not a field type), hierarchical, and external. Each carries a distinct contract.
A lookup relationship is the loose default. The child holds a foreign key to the parent. The child has its own owner and its own sharing settings. Deleting the parent does not cascade by default, although on a custom-object lookup an administrator may flip the "What to do if the lookup record is deleted?" setting to clear the value, prevent deletion, or cascade delete the child. A lookup field can be required or optional at the field level; if optional, the child can exist standalone with no parent. Roll-up summary fields are NOT available on the parent of a lookup; the parent has no way to count or sum its loosely-linked children declaratively. Lookup is the right choice when the child has independent existence, such as a Case lookup to Account where a case might be filed without an account in some flows, or a custom Contract Renewal record that lives even when the originating opportunity is gone.
A master-detail relationship is the tight parent/child contract. The child has no independent existence: deleting the master cascades and deletes every detail record automatically. The child has no separate owner field (the owner is implicit and follows the master) and no separate sharing settings (sharing is fully inherited from the master, which is why the security model needs no extra rules to align the two). The detail is mandatorily required at save time: a detail row cannot be created without a master. Master-detail is the only relationship that enables roll-up summary fields on the parent, where COUNT, SUM, MIN, and MAX of detail rows are computed and stored on the master. A single object can be the detail in at most two master-detail relationships at the same time, which is exactly the limit needed to build a junction. Converting a lookup into a master-detail in place is allowed only if every child row already has a populated parent value; converting a master-detail into a lookup is allowed only if no roll-up summaries depend on it.
A many-to-many relationship is the junction pattern. A junction object is a custom object whose only purpose is to sit between two parents and store two master-detail fields, one to each parent. The first master-detail created becomes the primary master, and that master owns the ownership and sharing of every junction row; the second master-detail is the secondary. Reparenting is allowed only when both master-details are configured to allow it. Deleting either parent cascades and deletes the junction row, which keeps the join table clean automatically. The canonical example is a Resources-and-Projects junction: a Project has many Resources and a Resource serves many Projects, so a ProjectResource__c junction object holds one master-detail to Project and one to Resource, with assignment-specific fields such as Role and Allocation Percentage on the junction row itself.
A hierarchical relationship is a special lookup that exists exclusively on the User object. It implements the Manager field, where each user can point to another user as their manager without creating a circular reference (the platform blocks a user from pointing to themselves transitively). Administrators cannot create hierarchical relationships on any object other than User; attempts to model recursive parent/child structures on, for example, Account or a custom Position object must be implemented as a regular self-lookup with the same target object on both sides.
📊 Limit: A single object can be the detail (child) in a maximum of 2 master-detail relationships simultaneously. This is the exact reason a junction object works: two master-details, one to each parent. Edition-wide field limits on a custom object cap lookups/master-details collectively under the Relationships limit per object (consult the current Salesforce edition limits reference for the per-edition number).
Standard vs custom objects in practice
| Property | Standard object | Custom object |
|---|---|---|
| API name suffix | None (e.g., Account, Opportunity) | __c (e.g., Project__c) |
| Can be deleted | No | Yes (subject to dependency checks) |
| Standard fields | Predefined, not removable | Only Name, plus admin-added custom fields |
| Activity tracking | Set by Salesforce per object | Toggle at object creation |
| Field history tracking limit | Up to 20 tracked fields per object | Up to 20 tracked fields per object |
| Sharing model | Predefined OWD baseline | Admin sets OWD at object creation |
| Renamable | Object Label can be re-labelled via Rename Tabs and Labels | Object Label and API name can be edited (API name change cascades to formulas/references) |
Relationship-type capability matrix
| Capability | Lookup | Master-Detail | Many-to-Many (junction) | Hierarchical | External Lookup |
|---|---|---|---|---|---|
| Child has own owner | Yes | No (inherits master) | No (inherits primary master) | n/a (User-only) | Yes |
| Child has own sharing | Yes | No (inherits master) | No (inherits primary master) | n/a | Yes |
| Child required to have parent | Optional or required | Always required | Always required | Optional | Optional |
| Cascade delete | Configurable (off by default) | Yes (automatic) | Yes (automatic on either parent) | No | No |
| Roll-up summary on parent | No | Yes | Yes (on either parent over junction fields) | No | No |
| Reparenting allowed | Yes | Off by default, can be enabled | Per master-detail, off by default | n/a | n/a |
| Max per child object | Up to the standard lookups-per-object limit | 2 | Realised as 2 master-details | 1 (on User only) | Up to external limit |
Decision Tree: Choosing the right relationship type
💡 Exam Trap: A scenario asks for a count of related child records on the parent and the parent/child link is described as "optional" or "the child should not be deleted when the parent goes away". The instinct is to grab roll-up summary, but roll-up summary requires master-detail, which requires the child to exist only with a parent. The correct answer is either to convert the relationship to master-detail (only possible if every existing child already has a parent populated) or to compute the count with a record-triggered flow on the child and update a number field on the parent.
💡 Exam Trap: "An object should reference itself, where one record is the parent of another record of the same type." Candidates often pick "Hierarchical". Hierarchical is User-only. For any object other than User, the correct mechanism is a self-lookup: create a lookup field on the object whose target is the same object. The Account standard object already ships with a built-in Parent Account field that is exactly a self-lookup.
⚠️ Anti-Pattern: Using a lookup between a custom Invoice and a custom Invoice Line Item because the administrator wants the freedom to delete invoice lines individually. The downstream cost is that any roll-up of line totals onto the invoice has to be built in Flow, sharing of lines does not inherit from the invoice, and an orphaned invoice line can survive its parent invoice. The right answer is master-detail with the line as detail; cascade delete and the sharing inheritance are exactly the desired behavior in an invoicing model.
🎯 Scenario: A Salesforce administrator at a professional-services firm is asked to model staffing assignments. A Project has many Consultants assigned to it, and a Consultant works on many Projects. Each assignment has a Role and an Allocation Percent. The administrator must choose: (a) a lookup from Consultant to Project, (b) a master-detail from Project to Consultant, (c) a junction object
ProjectAssignment__cwith two master-details (one to Project, one to Consultant), or (d) a hierarchical field on Consultant. The right answer is (c): the relationship is genuinely many-to-many, the assignment-specific Role and Allocation Percent must live somewhere, and a junction holds them on the join row. The first master-detail created on the junction (say to Project) becomes the primary master; sharing ofProjectAssignment__crows inherits from the Project. Deleting either parent cascades and removes the junction row.
Decision Anchor (Section 1)
Choose lookup when the child has meaningful independent existence and the business does not need declarative roll-up arithmetic on the parent. Choose master-detail when the child is genuinely a part of the parent (cascade delete is desired, sharing should be inherited, and a count or sum on the parent is a known requirement). Choose the junction pattern (two master-details on a custom join object) for any genuine many-to-many. Reserve hierarchical for the User Manager field; for any other "tree of records of the same type" use a self-lookup.
📊 Limit: Custom objects per edition: Group/Professional editions cap custom objects in the low hundreds; Enterprise, Performance, and Unlimited offer thousands. Custom fields per object are capped per edition (the per-edition number is published in the Salesforce edition limits reference). Field history tracking is limited to 20 fields per object. Long text area and multi-select picklist fields each count against tighter sub-limits inside the overall custom field count.
The platform also recognizes external lookups and indirect lookups for connecting Salesforce records to records that live in an external system surfaced through Salesforce Connect external objects. They behave like lookups for relationship purposes but the target is an external object, not a Salesforce table. They are out of scope as a primary relationship type for most administrator scenarios; their appearance on the exam is usually a distractor in a question asking for the right way to relate two normal Salesforce objects, where "external lookup" is the wrong answer unless the stem explicitly involves Salesforce Connect.
