- Salesforce - Navigating Setup
- Salesforce - Service Cloud
- Salesforce - Sales Cloud
- Salesforce - Environment
- Salesforce - Architecture
- Salesforce - Overview
- Salesforce - Home
Salesforce Objects
- Salesforce - Schema Builder
- Salesforce - Lookup Relationship
- Salesforce - Master Detail
- Salesforce - Custom Objects
- Salesforce - Standard Objects
Data Security
- Salesforce - Define Sharing Rules
- Salesforce - Create a Role Hierarchy
- Salesforce - Control Access Records
- Salesforce - Control Access Fields
- Salesforce - Control Access Objects
- Salesforce - Control Access Org
Process Builder
- Salesforce - Using Formula Fields
- Salesforce - Dashboards
- Salesforce - Reports
- Salesforce - Exporting Data
- Salesforce - Importing Data
- Automate Business Processes
Visualforce
- Salesforce - Static Resources
- Salesforce - List Controllers
- Salesforce - Using Forms
- Salesforce - Records, Fields & Tables
- Salesforce - Standard Controllers
- Salesforce - Variables & Formulas
- Salesforce - Visualforce Pages
Salesforce Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Salesforce - Master Detail Relationship
Unpke the relationships in relational database, the relationships in Salesforce are not through Primary and Foreign Keys. The relationships are maintained by using the Relationship Fields. It is a custom field which pnks one object record to another. Through the creation of relationships, we can display the data of all the related records in the record s details page.
The Master Detail relationship is used when we want to control the display of detail records based on the value in the master record. For example, in the courier company model a depvery schedule is always pnked to a depvery location. If we remove a depvery location from our pst, then all the related depvery schedules should also be epminated. Such a dependency can be achieved through Master-detail relationship between the sales force objects.
Features of Master-Detail Relationship
In this section, we will discuss the features of Master-detail Relationship. The features are psted below −
Deleting a Master Record, deletes all the detail records.
A detail record cannot be created without a Master record.
The permission on the detail record cannot be set. It inherits the permission from the master record.
The detail record also inherits the sharing rule from master records.
Both the master and detail records are automatically included in the report record types.
Creating Master-detail Relationship
In the courier company example, we will consider the relationship between depvery location and depvery schedule. There is a many-to-one relationship between the depvery schedule records and the depvery location record.
Following are the steps followed to create this relationship −
Choose the Relationship Type
In setup home, find the object named Depvery Schedule. In it under the Custom Fields and Relationships related pst, cpck New. Choose the Master-detail Relationship as shown in the screenshot below.
Choose the Related Object
In the next step, select the object with which this relationship will be created. We choose DepveryLocation.
Name the Relationship and Field
In this step, enter the Relationship Name as well as the name of the Field.
Add field to page layout
In the Next step we accept the defaults and move on to add the reference field to the page layout.
Add Custom Related Lists
Next, we specify the title for the related pst that is associated layout with the parent.
This completes the creation of Master-Detail relationship between DepveryLocation and Depveryschedule.
Advertisements