function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matt FolgerMatt Folger 

How do Master-Detail relationships work?

Hi, I'm trying to associate two objects that are coming from an external system.  I'm puzzled as to how a Master-Detail set of objects in Salesforce as even associated.  In MSSQL or other database software (or even Access!) I can create a join between two objects on a specific criteria.  In Salesforce I have no apparent options between two objects in the Schema Builder or Object Design to "Join" the Master-Detail objects together.  It is just a mandatory relationship, but what criteria is the join created with?  Seems like somewhere in the Schema Builder would specify what field the association of a Master-Detail is using.  

Any advice welcome!
Balagopal GBalagopal G

Hi,

Hope you are doing good.

User-added image

As you can see in the above image , there are two type of connections.

If you consider Account and Contact as a table, then the blue line shows that a contact can be connected you an Account (Company).

Since a contact(who stand alone) can also exists without a company , there its catogarised as a look up connection.
Where as , on Account table there is a Red Line which is connected to the same table where the field is mentioned to connect to the parent of the Account.

Master detail is a parent child relationship where the field value is required (child cannot exist without the parent ).

Kindly go through the following link to understand more : https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/relationships_among_objects.htm
 

Best Regards.

Have a nice day.

Raj VakatiRaj Vakati
If you want join you can create a junction object in salesforce 

https://developer.salesforce.com/docs/atlas.en-us.fundamentals.meta/fundamentals/adg_relationships_many_relationship.htm
Matt FolgerMatt Folger
Raj, aren't "Junction Objects" for if you have a many-to-many relationship?