Many organizations need to setup relationships between objects in Salesforce. In doing so, a choice must be made between a “Lookup” relationship and a “Master-Detail” relationship. I’m often asked about these options, and how to decide which one is needed.
Ask yourself these questions about your requirements:
- Do I want the visibility and edit-ability of my child object records to be ‘controlled by parent’? If yes, you need Master-Detail. Go with Lookup if you need record ownership, org-wide defaults, sharing rules, etc.
- Do I want my child records to be automatically deleted if I delete the parent? Go with Lookup if you don’t want cascade deletion.
- Do I want the ability to create Rollup Summary formula fields on the parent object that will sum/count/max/min the child records? If yes, you need Master-Detail.
- When users build reports with the child object as the report type, do I want the view options of the report to be based on the parent record ownership? (e.g. My Accounts, My Team’s Accounts, All Accounts, etc.) If yes, you need Master-Detail.
- Have I already created two Master-Detail custom fields on the child object? 2 is the maximum.
Hope this information helps you master the best practices of custom relationship field creation. Stay tuned for future posts regarding many-to-many relationships (junction objects) and considerations for using Lookup relationships.