[SalesForce] Any reason not to use Lookups instead of Master-Details for Junction object

To build n-m relationships one needs a Linker/Junction object with two references. The Salesforce documentation recommends two Master-Detail relationships.

Is there any reason why not to use two Lookups instead?

Best Answer

I see two reasons if we use look-up instead of master-detail type relationship:

  1. When you delete parent records, its child records will not be deleted. In case you delete both parent records, that linker record will be an orphan record and will eat your expensive storage. You will require an extra mechanism/components to trace those type of records.

  2. Security and Sharing will not be applied from parent to child. User may have access to child object record but not of the parent record. This causes inconsistent behavior.

There can be more reasons depending on use cases.

Related Topic