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
Duggempudi Narayana 5Duggempudi Narayana 5 

what is master detail relationship in salesforce

Rounak SharmaRounak Sharma
hello Duggempudi,

Master-detail
Closely links objects together such that the master record controls certain behaviors of the detail and subdetail record. For example, you can define a two-object master-detail relationship, such as Account—Expense Report, that extends the relationship to subdetail records, such as Account—Expense Report—Expense Line Item. You can then perform operations across the master—detail—subdetail relationship.
TIP Create a master-detail relationship before a custom object contains data.
Behaviors of master-detail relationships:
Deleting a detail record moves it to the Recycle Bin and leaves the master record intact; deleting a master record also deletes related detail and subdetail records. Undeleting a detail record restores it, and undeleting a master record also undeletes related detail and subdetail records. However, if you delete a detail record and later, separately, delete its master record, you cannot undelete the detail record, as it no longer has a master record to relate to.
By default, records can’t be reparented in master-detail relationships. Administrators can, however, allow child records in master-detail relationships on custom objects to be reparented to different parent records by selecting the Allow reparenting option in the master-detail relationship definition.
The Owner field on the detail and subdetail records is not available and is automatically set to the owner of the master record. Custom objects on the “detail” side of a master-detail relationship can't have sharing rules, manual sharing, or queues, as these require the Owner field.
Detail and subdetail records inherit security settings and permissions from the master record. You can’t set permissions on the detail record independently.
The master-detail relationship field (which is the field linking the objects) is required on the page layout of the detail and subdetail records.
The master object can be a standard object, such as Account or Opportunity, or a custom object.
As a best practice, don't exceed 10,000 child records for a master-detail relationship.
Each custom object can have up to two master-detail relationships and up to 25 total relationships.
The Related To entry can’t be changed after you save the relationship.

Please mark it as  the best answer if it helps
thanks
Team NubesEliteTeam NubesElite
Hi Rounak,
What is “Master-Detail Relationship”?
Master Detail relationship is the Parent child relationship.
In which Master represents Parent and detail represents Child.
If Parent is deleted then Child also gets deleted.
Rollup summary fields can only be created on Master records which will calculate the SUM, MAX, MIN of the Child records.
Up to 2 allowed to object.
Parent field on child is required.
Access to parent determines access to children.
Deleting parent automatically deletes child.
A child of one master detail relationship cannot be the parent of another.
Lookup field on page layout is required.


Thank You
www.nubeselite.com

Developement | Training | Consulting

Please Mark this as solution if your problem resolved.
Ajay K DubediAjay K Dubedi
Hi Duggempudi,

Click on the below link helpful for you:

https://www.tutorialspoint.com/salesforce/salesforce_master_detail_relationship.htm


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
Deepali KulshresthaDeepali Kulshrestha
Hi Duggempudi ,

Greetings to you!

Introduction of master-detail lookup relationship

Master Detail relationship is a one type of relationship which form tight bond relationship between Parent object and Child object.
Here we call Master Object as Parent and Child object as Detail object.  Child records should always associated to a parent they can not remain orphan. 
Cascade record deletions happens means when a parent object record is deleted all it’s child records get deleted automatically. 
Standard Objects can not be a detail object(Child object).

Example:-  Account(Standard Object) can not be detail object.

The master-detail relationship fields is required on the page layouts of the detail object. Roll-up Summary fields can be created on Master object(Parent Object.)
Child record inherits all security and sharing settings from it’s parent record.

Use below link to know more
https://www.tutorialspoint.com/salesforce/salesforce_master_detail_relationship.htm

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com