function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
joseph keuler 1joseph keuler 1 

Master Detail vs Lookup (pros and cons)

Is there any other difference between master detail and lookup relationships outside of ownership behavior, security implications, and referential integrity between the objects?

Thanks,
Joe
Best Answer chosen by joseph keuler 1
Amit Chaudhary 8Amit Chaudhary 8
Please check below below vedio.
https://www.youtube.com/watch?v=fUD4MzgA0gk
http://certifiedondemand.com/lookup-or-master-detail-relationship-in-salesforce
http://www.salesforcetutorial.com/object-relationships-in-salesforce/


What is a “Lookup Relationship”?
Up to 25 allowed for object
Parent is not a required field.
No impact on a security and access.
No impact on deletion.
Can be multiple layers deep.
Lookup field is not required.

 What is “Master-Detail Relationship”?
Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.
Up to 2 allowed to object.
Parent field on child is required.
Access to parent determines access to children.
Deleting parent automatically deletes child.
A child of one master detail relationship cannot be the parent of another.
Lookup field on page layout is required.

Please check below post for Type of relationship
https://help.salesforce.com/HTViewHelpDoc?id=relationships_considerations.htm
https://help.salesforce.com/HTViewHelpDoc?id=overview_of_custom_object_relationships.htm
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/relationships_among_objects.htm

Please let us know if this will help you

Thanks
Amit Chaudhary
 

All Answers

Jayson Faderanga 14Jayson Faderanga 14
other difference is, you can't create a rollup summary field on Lookup Relationship. it is only available on Master-Detail relationship. :D
 
joseph keuler 1joseph keuler 1
that's a good point.  If I'm primarily creating custom objects with no financial values or counts would lookups be easier to manage?  Also, could I use calculated fields or apex to create counts to display if I happen to use lookups instead of master-detail?
Amit Chaudhary 8Amit Chaudhary 8
Please check below below vedio.
https://www.youtube.com/watch?v=fUD4MzgA0gk
http://certifiedondemand.com/lookup-or-master-detail-relationship-in-salesforce
http://www.salesforcetutorial.com/object-relationships-in-salesforce/


What is a “Lookup Relationship”?
Up to 25 allowed for object
Parent is not a required field.
No impact on a security and access.
No impact on deletion.
Can be multiple layers deep.
Lookup field is not required.

 What is “Master-Detail Relationship”?
Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.
Up to 2 allowed to object.
Parent field on child is required.
Access to parent determines access to children.
Deleting parent automatically deletes child.
A child of one master detail relationship cannot be the parent of another.
Lookup field on page layout is required.

Please check below post for Type of relationship
https://help.salesforce.com/HTViewHelpDoc?id=relationships_considerations.htm
https://help.salesforce.com/HTViewHelpDoc?id=overview_of_custom_object_relationships.htm
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/relationships_among_objects.htm

Please let us know if this will help you

Thanks
Amit Chaudhary
 
This was selected as the best answer
Jayson Faderanga 14Jayson Faderanga 14
Hi Joseph,

if it happens you use lookups instead of master-detail, calculated fields or also known us formula field will not work but APEX will definitely work!
 
Afroz Ahmed 9Afroz Ahmed 9
Hi,
If you have any of these 4 requirements, then go with master detail (otherwise lookup)
  1. When the parent record is deleted all the child records attached needs to be deleted.
  2. All the users who can access a specific parent record will also has access to all the related child records (parent has private OWD setting and has sharing rules on top of it)
  3. wants to create rollup summary fields on parent
  4. activities tagged to child records has to be shown on parent account too
..
Aliaksandr VishneuskiAliaksandr Vishneuski
Only one remarque to  Best Answer: Rollup summary field can not calculate the AVG in one act.
S KumarS Kumar
@ Amit, for Parent-child, Should this line read 

Access to parent determines access to children.

As 

Access to Children determines access to Parent?
Trenton TeasdaleTrenton Teasdale
Also note that Average isn't a roll up type. The options are COUNT, SUM, MIN, MAX. Other than that great info!