Activity Forums Salesforce® Discussions Relationships

  • Vijay

    Member
    July 6, 2022 at 2:54 am

    In Master Detail Relationship, if you delete the master record then the child record automatically deleted.
    In Lookup relationship it won't, delete the child record when deleting the master record.
    This is also a scenario.

  • CRMJetty

    Member
    July 8, 2022 at 5:56 am

    Hello Naveen,There's fundamental differences in the behaviour and record sharing that you need to read up on. The following is purely a summary from memory and may not be 100% accurate, please refer to the salesforce help for a full explanation.

    • The key difference is master-detail has a direct dependency between the objects:
    • You cannot have a detail record without a master.
    • The detail record inherits sharing rules from the master.
    • You cannot update the relationship to the master in a master-detail relationship.
    • The number of master-detail relationships you can use are limited.
    • You cannot set profile object permissions for a detail record
    • Master-detail relationships are automatically included in report record types

    When you delete the master it will cascade delete all detail records relating to that master. A typical use of a Master-Detail would be the classic Sales Order and Sales Order Items objects.

    • Lookups are generally for use where you may or may need to have a relationship between two objects (but not always).
    • Lookups are generally used to reference commonly shared data, such as reference data.
    • Lookups are used to link two objects together when you don't want the behaviour of the master-detail - particularly around sharing rules, profile permissions and cascade delete.
    • Lookups are used when you need to relate multiple 'parents' to the detail record.

    You can change between a master-detail and a lookup after you create the field. My recommendation is always start with a Lookup relationship and then if you decide you need the features of a master-detail change it. If the detail object has it's own tab then you probably want to use a lookup not a master-detail.Thanks.

    • This reply was modified 2 years, 5 months ago by  CRMJetty.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos