Activity Forums Salesforce® Discussions What factor decide which relationship should be given(look up or master detail)?

  • What factor decide which relationship should be given(look up or master detail)?

    Posted by Suraj on March 29, 2017 at 11:16 am

    I know lookup and master detail but What factor decide which relationship should be given between any 2 Standard objects when?

    shariq replied 7 years, 5 months ago 3 Members · 2 Replies
  • 2 Replies
  • Manpreet

    Member
    March 29, 2017 at 1:12 pm

    Hi suraj,

    Before using any kind of relationship wheather Lookup / Master-Detail you need to pay attention towards the relation of child with Parent i.e wheather child should exist or not if parent gets deleted.Let me explain it to you with the help of a some scenarios.

    SCENARIO 1:

    Under a School , there are large no of Students.If school was shut , then all its students will have to leave that place.So for the student , school is must.So Master-Detail relationship best suits this scenario.

    SCENARIO 2:

    Shopkeeper and its Customers.If customer want something from the market then he/she can choose any shopkeeper.If one shopkeeper has closed his/her shop then customer can go to another shopkeeper to buy his/her commodity.So there's no direct dependency.Hence Lookup relationship best suits this scenario.

    I hope this will clear your confusion.

    Thanks.

  • shariq

    Member
    July 6, 2017 at 5:23 am

    Hi Suraj,

    When u are creating master detail relationship , the master is required, just like in real situation ,
    if there is a employee,it must work for a company(tight bound), if company closes then there will be no employee, if parent is deleted, child automatically deleted too.

    And in lookUp ,there is no need of parent, if parent is deleted, no effect on child.

    Hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos