There are several differences and several similarities as well.
Similarities:
- They both create a one (parent) to many (children) relationship. One Account could have many Opportunites on it.
- They both create a related list on the parent object listing the children.
- Both kinds of relationships are created from the child object in salesforce.com by creating a field that represents the relationship.
- Unless you specify explicitly when creating the relationship, a child in a master-detail reclationship typically cannot be re-parented. With a lookup relationship you just click the magnifying glass next to the lookup field from the child record. (Standard salesforce.com objects are sort of an exception here.)
- With a master-detail relationship, when you delete the parent record, the child records are deleted as well. With a lookup relationship, the child records are orphaned.
- With a master-detail relationship, you are able to use the "rollup summary" type of formula field on the master record. This allows you to sum/average/count records and fields on the records of the child object. For example you could have a count field on the account object that tells you how many opportunities there are for that account.
- Using a master-detail relationship the child is always created from the parent record. With a lookup field you can set filters to reduce the number of parent records viewed when clicking the magnifying glass to perform the lookup. This allows you to create the child object first, then link it to the parent record later.
- Custom Opportunity object with custom Opportunity Parts object. For this I would use Master-Detail. That way if the Opportunity is deleted, the parts records related to the Opportunity would also be deleted. Data related to the parts could be rolled up to the Opportunity and since it's very unlikely you'd ever have to reassign an opportunity part it would work well.
- Custom Hierarchy object. Use record types to define the levels of the hierarchy and a lookup field from Hierarchy object to itself to create the links. If you delete a higher level of the hierarchy it wouldn't delete all the lower levels, and you can reassign as the shape of the hierarchy changes.
- Custom Request object and Standard User object. I'd use a lookup field to the user object if you want to relate a user other than the CreatedBy user. For example if the request needs to be approved by the user's manager, you could have a lookup field from the Request to the User object that is filled with the manager's name either by workflow rule or by the user. If the user's manager changes, the prior requests won't be deleted.
Comments