How do I reference a master detail relationship in Salesforce?
Mia Smith
Published Feb 19, 2026
How do I reference a master detail relationship in Salesforce?
In the selected custom object, click on new in the custom fields and relationships list. Select Master-detail relationship and click on next where you will get a pick list to select the other object which you want to relate. Click on next after selecting another object.
What is master detail relationship in Salesforce with example?
The Master Detail relationship is used when we want to control the display of detail records based on the value in the master record. For example, in the courier company model a delivery schedule is always linked to a delivery location.
Can a standard object have more than one master detail relationship?
You can have up to three custom detail levels. Standard objects can’t be on the detail side of a custom object in a master-detail relationship. An object can appear one time in multilevel master-detail relationships.
How do I reference another object in a formula in Salesforce?
When referencing a custom object, add two underscores and the letter r to its name. For example, Position__r. title__c references the Job Title field ( title__c ) on a Position custom object.
What is the difference between a lookup and master detail relationship?
The Salesforce lookup relationship has no relation with other records. It does not depend on any other objects, whereas a master-detail relationship has an association with other records. On the other hand, the lookup relationship is just a reference. It can be even blank or NULL.
How do you create a master detail relationship between two objects?
Create a Master-Detail Relationship
- On the Object Manager page for the custom object, click Fields & Relationships.
- Click New.
- Select Master-Detail Relationship and click Next.
- For Related To, choose Property.
- Click Next.
- For Field Name, enter Property and click Next.
- Click Next, Next, and Save.
What is the difference between lookup relationship and master detail relationship?
What do master detail relationship involve?
Master-Detail (1:n) — A parent-child relationship in which the master object controls certain behaviors of the detail object: When a record of the master object is deleted, its related detail records are also deleted.
Can a child record be a master to some other object?
By default, records can’t be re-parented in master-detail relationships. Administrators can, however, allow child records in master-detail relationships on custom objects to be reparented to different parent records by selecting the Allow reparenting option in the master-detail relationship definition.
What is cross reference in Salesforce?
A cross-object formula can reference merge fields from a master (“parent”) object if an object is on the detail side of a master-detail relationship. A cross-object formula also works with lookup relationships. You can reference fields from objects that are up to 10 relationships away.
What is the syntax to reference a field in a formula?
Summary of Formula Reference Types Format it this way Type a $ symbol in front of the column name, row number or both. Format it this way Use a comma between cell references. Format it this way Reference the first cell in the range, then the last cell, separated by a :(colon).
Can we convert lookup into master detail relationship and how?
To convert lookup to the master-detail relationship you need to give parent records on all child records. Then only you can convert a lookup relationship to a master-detail relationship if the lookup field in all the records contains a value.