Thursday, January 9, 2014

Master-Detail relationship

Sometimes new admin confuse what is 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.

But, fundamentally it is different between Master-Detail with Lookup relationship. Few items you need to notice on Master-Detail relationship:

  1. When a record of the master object is deleted, its related detail records are also deleted.
  2. The owner field on the detail object is not available and is automatically set to the owner of its associated master record.
  3.  The detail record inherits the sharing and security settings of its master record.
  4. The master-detail relationship field is required on the page layout of the detail record.
  5. By default, records can’t be reparented 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.
  6. You can define master-detail relationships between custom objects
  7. 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.
  8. You can display detail object record as custom related list on master object page layouts.
  9. 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.
  10. If the object is master of 1 or more detail object, you only can have 1 parent object for that object.


Post a Comment

| ,