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
Saumya SumanSaumya Suman 

Master detail

why we create 2 master detail relationship per object?
SandhyaSandhya (Salesforce Developers) 
Hi,


A custom object with two master-detail relationships is called Junction Object. Using a custom junction object, you can model a “many-to-many” relationship between two objects. For example, you create a custom object called “Bug” that relates to the standard case object such that a bug could be related to multiple cases and a case could also be related to multiple bugs.

Refer below salesforce help article which has the usecase for the same.

https://help.salesforce.com/articleView?id=relationships_manytomany.htm&type=5

Please mark it as solved if my reply was helpful, it will make it available
for others as a proper solution.

Best Regards,
​Sandhya
 
Akshay_DhimanAkshay_Dhiman
Hi Saumya,

While lookup relationships are fairly casual, master-detail relationships are a bit tighter. In this type of relationship, one object is the master and another is the detail. The master object controls certain behaviors of the detail object, like who can view the detail’s data.

But the major difference in Master-detail relationship and lookup relationship is that in Master detail when we delete master then automatically child is also deleted.

Here is a Trailhead link, hope this will also help you.
https://trailhead.salesforce.com/en/modules/data_modeling/units/object_relationships

If this is helpful please mark it as best answer.

Thanks
Akshay.
Saumya SumanSaumya Suman
But I want to know why we create only 2 master detail per object? Can't we create more than 2?