Sep 19, 2018

Differences Between Lookup and Master-Detail Relationships in

Differences Between Lookup and Master-Detail Relationships:

There are fundamental differences between the two types of relationships in areas such as data deletion, sharing, and required fields in page layouts.

  • Master-detail relationships are typically used when there is a direct dependency between the two objects. These relationships have the following unique features.
  • You can’t create a detail record without a master record.
  • When you delete a master record, all its detail records are automatically deleted.
  • The detail record inherits sharing rules from the master record.
  • The number of master-detail relationships you can use are limited, depending on your edition and license.
  • You can’t set profile object permissions for a detail record.
  • Master-detail relationships are automatically included in report record types.

Lookup relationships are appropriate when a relationship between two objects is required in some cases, but not always. Typical scenarios for lookup relationships are:

  • To reference commonly shared data, such as reference data.
  • To relate multiple parent records to the child record.
  • To link two objects together when you don't want the behavior of the master-detail relationship, such as sharing rules, profile permissions and cascade delete.
  • If the detail object has its own tab, then you probably want to use a lookup, and not a master-detail, relationship.

It’s possible to change a lookup relationship to a master-detail relationship, but not the other way around. Hence, if you're in doubt which one to use, it’s best to start with a lookup relationship. If you later decide you need the features of a master-detail relationship, you can change it.