Difference between master-detail relationships and lookup relationships in Salesforce.

Asked 03-Feb-2018
Viewed 1010 times

0

1 Answer


0

Below I have described some of the difference between Master-Detail Relationship and Lookup Relationship:

Master-detail relationship Lookup relationship
In this relationship, we can define a Master-Detail Relationship between Custom Object and a Standard Object. But the Standard Object must be the Parent. In this relationship, we can define a Relationship between Standard Or Custom Object. In this relationship, If the Master Object record will delete, then all the records of the Detail Object or Child Object are related to that Master Record will be deleted.
In this relationship, when a parent object deleted, then we can configure a child object to either clear the parent record value in the child record or prevent deletion of the parent record .In this relationship, all the child records must have a related parent record.
 In this relationship, the parent record may not require a related parent record.
In this relationship ownership of the child record is determined by the related parent record, and also the Child records do not have an owner. In this relationship, each of the child records has an owner and is not related to the parent record.
In this relationship, the detail record inherits sharing and the security from the master record. In this relationship, the detail record inherits sharing and the security from the master record.
In this relationship, there is no security or inheritance between related parent and child records. In this relationship to relate an object to another object, no records should exist in the child object.
In this relationship, if we have the Roll-Up Summary field in the parent object, then the edit action will occur in the Parent Object when triggers like create, edit, or delete happened in the child record. If we have a validation rule in the parent object, then the validation rules will trigger for the parent object. In this relationship, we cannot create the Roll-Up Summary field in the lookup relationship using out-of-the-box.
In this relationship, it will support cross-object workflow. We can configure a field update action to update a field in the parent record using a value from the child record.  In this relationship, it does not support cross-object workflow.

So, now for an existing object create a master-detail relationship with the records as the Child object, we can initially define it as a lookup relationship, populate all Parent fields for all the records, and then change the relationship to a Master-Detail relationship. 

We can build a many-to-many object relationship using two Master-Detail relationships in a single custom object, which is known as a junction object in that case.