A master-detail relationship defines the relationship between the parent and the child. The master table defines the parent relation and the detail defines the child relation. If the master table is deleted then the child record data is also deleted. The RUS(Roll-Up Summary) fields are also created on master records.
Want to enhance your skills in dealing with the world's best CRM, enroll in our Salesforce Online Course
Let us start with an example, create two different Objects for Master-detail relationship, and have a look at the benefits we have in MDR.
Eg: Two Objects.
I have included simple fields for “Company Names & Employees” Objects as shown in the below figure.
For MDR, we need to create a relationship field on one of the Objects. Select for strong relationship bonding not as “Lookup relationship”.
I have taken Employees Object and created an MDR field in it. The process includes,
Click on Employees >> Click “Quick Access Menu” >> Add “New Field”.
Step1: Choose Field Type (Master Detail Relationship) >> Next.
Step2: Select the appropriate Object on which the relationship should be established.(eg: Company name) >> Next.
Step3: Fill in the details and proceed to the next step.
Step4: Provide with all the required security level check and proceed to the next step.
Step5: In this step, we will add a reference field for MDR to the page layout and proceed for next step.
Step6: In this step, we will add a custom related list of the desired Object and Save.
With the above steps, the MDR relationship is established. The below displays the relationship.
Hence, we can look at the MDR created between the “Company Names and Employees”
Let us add, an New Employee to the Object. We can observe that without the “Company Name” entering, it is unable to proceed to the next step. So, click on the magnifying glass located to the field next to enter “Company name”, you can select the company name for which the employee belongs to.
Note: We can create upto 2 MDR in 1 Object. Not more than that.
Let us delete the “Company Name” (eg.Tech Mahindra), from the list and observe the dependency, cascading delete & master-detail relationship work process.
Below is the example for the primary and secondary records relations, in which the “Owner” of the “Company Object” becomes the Owner of the “Employees Object”. So, the Owner field is not visible in the assigned company employee record details.
Master Detail Fields:
Few Points About Master-detail Relationship:
A roll-up summary determines the values of the related records, whereas in a related list. We can create a roll-up summary to display values of the master record based on field values in the detailed record, and the record must be related to MDR.
Let us create a RUS field in the desired “Company” from the list and observe the process.
Click on the “Company Names Object” >> Click on the quick access menu located on the right side of the application area(Org) >> New Field.
Step 1: Select the “Roll-Up Summary” >> Proceed to the next step.
Step 2: Enter the details of the field name. (Eg. Maximum Experience) >> proceed to the next step.
Step 3: select the summarised object. (Eg. Employees) >> Select the Roll Up type. (Eg. Max) >> select the field to aggregate. (Eg. Experience) >> Filter Criteria (Eg. All records) >> Proceed to next step.
Note: In filter criteria, the other option is used for filtering based on operator and values.
Step 4: In this step select who all can visualize the RUS field. >> proceed to next step.
Step 5: In this step the default selection of “Add the Page layout” >> proceed to Save button.
The Roll-Up Summary field in the “Company Names” displays the highest experience number in the “Maximum Experience” field in the “Company Names” object.
Reparenting allows you to edit the parent details of the Object, which is not allowed to edit.(Eg.Employee).
Checkout Salesforce Interview Questions
Click on the “Employee” Object edit >> Custom fields and relationships >> Edit >> master-Detail Options >> Allow Reparenting >> Save.
After Save Go to Employees Object >> Select Employee >> Edit >> Option to select Company Name.
Checkout SalesForce Sample Resumes
In the next topics, we will discuss in detail about “Salesforce Security”. Keep following us for more info on Salesforce Administration.
Mindmajix offers different Salesforce certification training according to your desire with hands-on experience on Salesforce concepts
Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:
Name | Dates | |
---|---|---|
Salesforce Training | Nov 19 to Dec 04 | View Details |
Salesforce Training | Nov 23 to Dec 08 | View Details |
Salesforce Training | Nov 26 to Dec 11 | View Details |
Salesforce Training | Nov 30 to Dec 15 | View Details |
Arogyalokesh is a Technical Content Writer and manages content creation on various IT platforms at Mindmajix. He is dedicated to creating useful and engaging content on Salesforce, Blockchain, Docker, SQL Server, Tangle, Jira, and few other technologies. Get in touch with him on LinkedIn and Twitter.