Master-Detail relationship is a type of relationship, one object acts as a master, and the other acts as a detail object. In other words, this relationship acts as a parent-child relationship. We use this type of relationship when we want to bound two objects tightly or closely dependent on each other.
Important Points Regarding Master-Detail relationship (MDR)
- In Master-Detail Relationship the “child object” or “detail object” must have a parent.
- Roll-up Summary fields can be established.
- Records can be re-parented.
- Standard objects can not be a detailed object
- Maximum 2 Master-Detail Relationships can be created for an Object.
Steps to create a Master-Detail Relationship(MDR).
Assuming a situation that any Company is there and we have to create Master-Detail Relationship on the contact of Employee’s who’s working in Company.
Step1-:Login to your org.
Step 2-:Setup > Object Manager > Employee
Step3-: Click on field & Relationship > New
Step 4-: Select Master Detail Relationship >Next.
Step 6-: Select Contact from the drop-down > Next.
Step 6-: The next page will be containing Child Relationship with a parent.
Step 7 -: Next step is Field-level Security.
Step 8-: Another Step is for the Page Layout Reference
Step 9 -: Last step is the Addition of a Related list and Saving the Master-Detail Relationship.
Conclusion: Here we have got a detailed Step by Step understanding of how to create a Master-Detail Relationship.
Happy learning
Written By: Ashutosh Tiwari