Some new Salesforce admins may confuse with the different between Master-Detail relationship with Lookup relationship, since both are used to link an object to another object, and you can use parent-child relationships in SOQL queries for both relationship.
But fundamentally, it is different between Master-Detail with Lookup relationship, few items you need to notice on Master-Detail relationship:
- When a record of the master object is deleted, its related detail records are also deleted.
- The owner field on the detail object is not available and is automatically set to the owner of its associated master record.
- The detail record inherits the sharing and security settings of its master record.
- The master object field is always required in the page layout of the detail record (in child object).
- By default, records can’t be re-parented in master-detail relationships. However, administrator can set to allow child records in master-detail relationships on custom objects to be re-parented to different parent records, by enabling Allow re-parenting check box in the master-detail relationship definition.
- You can define master-detail relationships between custom objects.
- You also can define master-detail relationships between a custom object and a standard object, but the standard object cannot be on the detail side of a relationship with a custom object. In addition, you cannot create a master-detail relationship in which the User or Lead objects are the master.
- You can display detail object record as custom related list on master object page layouts.
You cannot create tab for a child object- You can use master-detail relationships to model many-to-many relationships between any two objects. Maximum 2 master-detail relationship from a custom object.
- If the object is master of 1 or more detail object, you only can have 1 parent object for that object.
- If you have Roll-Up Summary field in parent and summarized with particular child object, when you create / update that child record, it will "edit" parent record, so if any validation rule triggered, it will stop to save when create / update child record.
No comments:
Post a Comment