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
Pankaj_KatharPankaj_Kathar 

How to identify Primary and Secondary Master-Detail relationship for Junction object

Hi

How to identify which is the Primary and which is a Secondary Master Detail relationship for a junction object?


Thanks,
Pankaj Kathar
Best Answer chosen by Pankaj_Kathar
Carla Llewellyn 1Carla Llewellyn 1
Hi @Shani Kathar, If you go to https://workbench.developerforce.com in another tab in the same browser window as your logged in Salesforce instance, you should be able to see which is primary and which is secondary. 
1. Check the "I agree to the terms of service" box and click Login with Salesforce.
2. Choose "Standard and Custom Objects" in the "Jump to" picklist.
3. Choose your object with the 2 master-detail relationships in the "Object" picklist.
4. Expand the "Fields" folder by clicking on the folder icon.
5. Expand both of the master-detail field's folders.
6. Look at the "Relationship Order" parameter for both of the fields.

The field where Relationship Order equals 0 is the Primary and the field where Relationship Order equals 1 is the Secondary. 

I hope this helps!

All Answers

v varaprasadv varaprasad
Hi Pankaj,

Please check once below Info you can identify understand what is primary or secondary objects.


The first master-detail relationship you create on your junction object becomes the primaryrelationship. 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.
Division: If your organization uses divisions to segment data, the junction object records inherit their division from their associated primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail relationships.

More Info : 

https://help.salesforce.com/articleView?id=relationships_considerations.htm&type=0 

Hope this helps you.

 if it helps you, close your query by choosing best answer so it make proper solution for others.

Thanks
Varaprasad


 
Pankaj_KatharPankaj_Kathar
Thanks @piyush_soni and V Varaprasad.

My question is still how do i just identify by looking which is the primary and which is the secodary M:D relationship for any junction object?
Carla Llewellyn 1Carla Llewellyn 1
Hi @Shani Kathar, If you go to https://workbench.developerforce.com in another tab in the same browser window as your logged in Salesforce instance, you should be able to see which is primary and which is secondary. 
1. Check the "I agree to the terms of service" box and click Login with Salesforce.
2. Choose "Standard and Custom Objects" in the "Jump to" picklist.
3. Choose your object with the 2 master-detail relationships in the "Object" picklist.
4. Expand the "Fields" folder by clicking on the folder icon.
5. Expand both of the master-detail field's folders.
6. Look at the "Relationship Order" parameter for both of the fields.

The field where Relationship Order equals 0 is the Primary and the field where Relationship Order equals 1 is the Secondary. 

I hope this helps!
This was selected as the best answer
Pankaj_KatharPankaj_Kathar
Great - thanks Carla - this is exactly what i was looking for! I am really happy to know workbench functionality, thanks again :)
Carlos A. GallardoCarlos A. Gallardo
Thanks Carla! Incredibly helpful still ~6 months later. :)
Nupur Jain 17Nupur Jain 17
Thanks Carla. Still very useful. :)