Object Relationships

See Objects for an understanding of how to create object relationships.

20 Responses to “Object Relationships”

  1. sneha06 August 7, 2016 at 6:17 am #

    Hi John,

    As mentioned in the video there are some scenario where one contacts can have multiple accounts but only one primary account. Could you please explain that in details with example.


    • JohnCoppedge August 17, 2016 at 2:33 pm #

      Perhaps I am a full time employee at one company (primary account) and an adviser on another account (secondary account)

  2. fredrik.schenatz@eins.se July 7, 2016 at 8:37 am #

    Basic information but explained in a very good and easy way!

  3. CarlosSiqueira May 25, 2016 at 10:16 pm #


    I checked the junction object Campaign Member and was expecting to find 2 master -detail fields, one for Campaign and one for Contacts, but only found Lookup fields for Campaign/Contacts.
    Why? According to this piece from SF, a many-2-many requires the junction object to have to 2 master-detail fields, one for each “parent”:

    Is this true only for custom objects? Standard objects in a many-2-many will only allow Lookup instead of Master-detail? Thanks

    • JohnCoppedge May 27, 2016 at 2:56 pm #

      There are some built in relationships in salesforce that don’t act completely standard (e.g. if you re-created the relationship it would not work the same way). Account/Opp is another one. You can create a rollup on account from opp data, despite it being a lookup relationship.

  4. MKlobe March 30, 2016 at 9:25 pm #

    How come master-detail isn’t touched upon here?

  5. tejalr8@gmail.com January 22, 2016 at 10:02 pm #

    Hi John,
    I have few questions regarding M-D relationships
    I m cosidering this scenatio
    i have 3 objs.
    ObjA ObjB ObjC
    relation ship goes like this

    now further i want to have obj C to b in hierarchical from B

    means Obj A is master B is detail and again i want ot create another relationship that is B is master and C as detail.

    in that case if next step, if i think of going C as master and A as detail, is it possible?

    Another question is if in other case ,i have A – standard obj…just want to make sure that standard object can never be detail side .?

    Another question,(a-B0 master detail as primasry for further hirarchy…

    When i have hierarchical relation ship like A master B is detail
    and further B is master and C is Detail………..does the record owner of C will b the record owner A .?
    Thank you for your kind support.


    • JohnCoppedge January 25, 2016 at 8:11 pm #

      I’d have to test out the first scenario – I don’t think you can set up a relationship like that…

      Standard objects cannot be detail, correct.

      I believe the record ownership would cascade from the grandparent- would suggest double check to be sure, but I believe that is correct.

  6. chris.jenkinson@hotmail.com.au December 1, 2015 at 3:58 am #

    None of the videos in the data model are working “an error occurred”

  7. Farzana Hafiz August 28, 2015 at 5:59 am #


  8. Chuck Fernald December 22, 2014 at 7:28 pm #

    Is it possible to relate a standard object back to itself using 2 many-to-many lookups in a custom join object? The use case is for displaying a related list for account records of 1 record type in the record of another account record – more specifically account records of each of our retail sales outlets and accounts of our distributor sales channel who also sell to the same accounts in our retail channel. Thanks!

    • JohnCoppedge December 22, 2014 at 7:35 pm #

      Yes you could create a custom object to establish a many to many relationship between the same object – e.g. an “Account Relationship” object. I don’t believe you can have two master-detail relationships relating to the same object, however. Therefore you would probably need to have a “primary” account on the junction object that was mater-detail and the other relationship would be lookup.

  9. Chuck Fernald September 14, 2014 at 4:43 pm #

    What relationship is Task to Lead? Is that the same as for Task to Contact? Could either of those pairs be considered a parent-child? Finally, is the schema builder the best place to observe all the different object relationships in an org? Thanks, Chuck

    • JohnCoppedge September 27, 2014 at 7:34 pm #

      The relationship between task an object is I believe technically considered a lookup – but it isn’t a standard lookup relationship.

      The task can be related to many different objects, whereas a standard lookup field relates specifically to a single object.

      It definitely isn’t a master-detail relationship, as you can’t create rollups based on task data.

      [comment edited for clarity]

      • Rena Bennett-Dellwo February 11, 2015 at 6:29 pm #

        Did you mean “can create rollups” or “can’t…”?

Leave a Reply