Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Master-Detail Relationship entry
How-to guide

How to create a Master-Detail Relationship in Salesforce

Master-Detail Relationships create a tight parent-child binding — child inherits parent's sharing, child requires the parent (deletion cascades), parent enables Roll-Up Summary fields. Use when child records have no meaning without the parent (e.g., Order Line Items don't exist without an Order). One-way decision: converting to/from Master-Detail loses data.

By Dipojjal Chakrabarti · Editor, Salesforce DictionaryLast updated Apr 20, 2026

Master-Detail Relationships create a tight parent-child binding — child inherits parent's sharing, child requires the parent (deletion cascades), parent enables Roll-Up Summary fields. Use when child records have no meaning without the parent (e.g., Order Line Items don't exist without an Order). One-way decision: converting to/from Master-Detail loses data.

  1. Open Setup → Object Manager → child object → Fields & Relationships → New

    Master-Detail is created on the child.

  2. Pick Master-Detail Relationship as the field type

    Different from Lookup. Locked behavior.

  3. Pick the Related To object

    The parent / master object.

  4. Set Field Label and Field Name

    Label and API name.

  5. Configure Sharing Setting

    Read/Write — child users with Edit on master can edit child. Read Only — child users with Read on master can view child but can't edit.

  6. Configure Allow Reparenting (optional)

    When ON, the lookup can be changed to a different parent later. When OFF (default), the master is locked once set — adds data integrity but limits flexibility.

  7. Save

    Field is created. Now child records require a parent.

  8. (Optional) Add Roll-Up Summary fields on the parent

    Master-Detail unlocks Roll-Up — go to the master object and add COUNT / SUM / MIN / MAX rollups against this child.

Mandatory fields
Field Label and Namerequired

Required.

Related To master objectrequired

Required. Locked after Save.

Sharing Settingrequired

Required. Read/Write or Read Only.

Gotchas
  • Master-Detail child records require a parent — cannot exist without one. Trying to create a child via API without setting the parent ID fails.
  • Deleting a master cascades to ALL its detail records. Test cascade deletes carefully — there's no undo. Salesforce's Recycle Bin holds for 15 days.
  • Converting Lookup to Master-Detail (or vice versa) requires data alignment. Lookup with NULL values can't convert to Master-Detail without first populating the lookup. Plan migrations carefully.

See the full Master-Detail Relationship entry

Master-Detail Relationship includes the definition, worked example, deep dive, related terms, and a quiz.