4

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?

  • 1
    Linker object = junction object right ? – Samuel De Rycke Nov 10 '15 at 8:57
6

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.

  • A third very important reason is that you have access to a special report type when using two MDs to create the many-to-many relationship. This facilitates reporting capabilities you wouldn't otherwise have. – Wes Nolte Aug 10 '16 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.