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
Priyank BansalPriyank Bansal 

If an object has two Master-Details relationships and one master is private and another is public readonly then how the visibility of the child will behave?

Hi,
I have three objects.i.e. Car, Driver and Booking. Booking has Master-Detail relationship with the Car and Driver Objects. OWD of the Car is public Read/Write and for Driver it is Read only.
In such scenario, how the visibility and secuity setting of Booking will behave in the application.

Regards
Priyank
Best Answer chosen by Priyank Bansal
Chamil MadusankaChamil Madusanka
The first master-detail relationship you create on your junction object becomes the primary relationship. This affects the following for the junction object records:
  • Look and feel: The junction object's detail and edit pages use the color and any associated icon of the primary master object.
  • Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.
The second master-detail relationship you create on your junction object becomes the secondary relationship. If you delete the primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.

If you get the answer, please mark it as the correct answer. It will be a help to others who are facing the same problem later.
 

All Answers

Chamil MadusankaChamil Madusanka
The first master-detail relationship you create on your junction object becomes the primary relationship. This affects the following for the junction object records:
  • Look and feel: The junction object's detail and edit pages use the color and any associated icon of the primary master object.
  • Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.
The second master-detail relationship you create on your junction object becomes the secondary relationship. If you delete the primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.

If you get the answer, please mark it as the correct answer. It will be a help to others who are facing the same problem later.
 
This was selected as the best answer
ABHISHEK CHOPRAABHISHEK CHOPRA
Hello Chamil, thanks for your wondeful explanation on master detail heirarchy.

Can you also let me know how will we get to know which is the Primary master object and which is secondary?
How this can be checked ?
Job Posting has two master detail relatioship one with position and other with Employment website object, then which one will be primary and other secondary?

Thanks,
Abhishek
Sunil Kumar Reddy YSunil Kumar Reddy Y
 Hi ABHISHEK CHOPRA
You can use Workbench under 'Standard and Custom Objects' there is 'Relationship Order' parameter which says Primary(0) or Secondary(1) 
Drew ChaplinDrew Chaplin
I know this is like five years old, but it just caught me.    The answer is given by Chamil Madusanka only applies to who the owner will be if BOTH the M-D relationship is deleted.

From the same SF reference:
https://help.salesforce.com/articleView?id=relationships_considerations.htm&type=5
Sharing access to a junction object record is determined by a user's sharing access to both associated master records and the Sharing Setting option on the relationship field.