Salesforce is a cloud-based online solution for customer relationship management (CRM). Salesforce provides all the departments - like marketing, sales, commerce, and service - with a shared view of our customers in a single integrated CRM platform.
Relationships in Salesforce
A relationship is a two-way association between two objects. We create relationships to link objects with each other so that when the users view records, they can also see related data. Avoiding data redundancy and data inconsistency, we are in need of relationship. We can define different types of relationships like Master-Detail Relationship, Lookup relationship and Many to Many Relationship.
Master-Detail Relationship
A master-detail relationship is a parent-child relationship where the master is like a parent and detail is like a child in which master object controls some behaviors of the detail object. Also, when a Master object record is deleted, the detail object related to it also gets deleted.
Lookup relationship
Lookup Relationship is nothing but creating a relationship between two same objects. This Lookup Relationship is a Self-relationship to the same object.
Many to Many Relationship
A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa.
In this article, we will learn how to create a Master-Detail Relationship between student and department objects in SalesForce.
The prerequisites are for creating a Master-Detail Relationship in SalesForce are - Register a Salesforce Free Trial account using the following link.
Step 1
Log into your Salesforce account and click "Setup".

Step 2
Click the Object Manager and create the Department, Studentobject (custom object – Refer How to create custom object) and create the Department custom fields (DepID, DepName, DepIncharge, DMobno) and student object custom fields (StudID, SName, SMobno, SEmail)(Refer How to create custom Field).


Step 3
After creating the Student and Department objects, now we can create Master-Detail Relationship between Department and Student objects.














Soundhar Raj TPosted Jul 18, 2019, 3:45 AM
Thank's sir