4

Master-Detail Relationship in Salesforce

Master Detail Relationship In Salesforce 

The Master Detail relationship in Salesforce is a parent-child relationship in which the master object controls certain behaviors of the detail object, meaning the child object depends on the parent. The master object controls sharing, security, and ownership of the detail object, and supports roll-up summaries that retrieve data from child records.

Practice Exam
eGuide form

Master-Detail Relationships in Salesforce Practice Exam

Features Of Master-Detail Relationship In Salesforce

Below are the following features of a Master-Detail relationship.

  • When a record of the master object is deleted, its related detail records are also deleted.
  • The detail record inherits the sharing and security settings of its master record.
  • The Owner field on the detail object is not available and is automatically set to the owner of its associated master record. 
  • Custom objects on the detail side of a master-detail relationship cannot have sharing rules, manual sharing, or queues, as these require the Owner field.
  • The master-detail relationship in Salesforce is a mandatory field on the detail record’s page layout, as it must be linked to the master to be saved. 
  • 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.
  • It can be defined between custom objects or between a custom object and a standard object. However, the standard object cannot be on the detail side of a relationship with a custom object.
  • Lead and User standard objects can not be on the master side.
  • The data relating to the object appears on a related list on the master record page klayout. The related list is automatically created when the relationship is defined.
  • When we undelete the master record, all its related detail records also get undeleted.
  • The maximum depth of the master-detail relationship is 2, i.e., after 2 levels, we can’t make more master-detail relationships in continuation.
Note: A master-detail relationship cannot be created where the user or lead objects are the master.
Salesforce-Admin-Training-CTA
Next Topic

Need more support?

Get a head start with our FREE study notes!

Learn more and get all the answers you need at zero cost. Improve your skills using our detailed notes prepared by industry experts to help you excel.

Frequently Asked Questions

What is the master-detail relationship in Salesforce?

A master-detail relationship in Salesforce is a parent-child relationship. Here, the detail record is highly dependent on the master records. If the master record is deleted, the detail records are all deleted.

What happens when a master record is deleted in Salesforce?

When a master record is deleted, all associated detail records are automatically deleted. If teh amster records are restored, the detail records are also restored.

What are roll-up summary fields in Salesforce?

Roll-up summary fields are master object fields that trigger values from related detail records. It uses functions like COUNT, SUM, MIN, and MAX.

Can a standard object be on the detail side of a master-detail relationship?

No, in Slaesforce amster detail relationship, only a custom object can be on the detail side.

Book Free15-Minutes Career Counselling