Object Relationships

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

24 Responses to “Object Relationships”

  1. Thepride21 June 22, 2017 at 6:16 am #

    Hi John,

    The relationship between Profile and PermissionSet is indicated as One to One. I am still not clear how this relationship is established. Aren’t they independent of each other?

    • JohnCoppedge June 22, 2017 at 12:41 pm #

      Not clear to me either- what might be happening is that a permission set may actually be creating a profile under the covers… that’s the only thing I can think of. But I don’t think you’ll ever see a relationship between a profile and permission set through standard admin config

  2. knowlgo April 26, 2017 at 2:52 pm #

    I take it that since you only reference the One to many and not the One to Zero or More that they ignore that part and call one to zero or more, one to many.

    • JohnCoppedge April 26, 2017 at 6:16 pm #

      Yeah zero versus one in the salesforce ecosystem generally isn’t critical to understand – its provided to explain the data models that salesforce provides. In some areas, for example user to profile (which is a strict one to many, a user MUST have one profile) the nuances are more relevant.

  3. 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)

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

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

  5. 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.

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

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

  7. 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.

  8. 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”

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


  10. 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.

  11. 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