- What is the Salesforce lookup relationship?
- How to create a Lookup Relationship in Salesforce?
- Types of Relationships in Salesforce
- Many to many relationships
- External relationships
- Conclusion
What is the Salesforce lookup relationship?
A Salesforce lookup relationship is capable of linking two different objects collectively, allowing you to look up for one object based on the related items on another object. In simple terms, it helps in finding the value of a field based on the value that is present on the other field in a different object.
Let us gain an understanding about a relationship in Salesforce with an example of the agents table. In this table, it includes two things - agent name and manager assigned. Apart from these, it also includes certain information like the first name, last name, ID, etc. The master manager is capable of holding the header data as well. The agent declaration fields will be included in the other table. There is a connectivity between these records- establishing a master -detail relationship with the table called manager.
Here, we understand that the lookup relationship is just for reference basis which can either be NULL or blank. In the database management systems, it is possible to retrieve the data based on the fields and reference keys, likewise in the Salesforce platform as well. The object reference is considered in the Salesforce lookup relationship.
Let us summarize shortly.
- A lookup relationship in Salesforce is responsible for forming a loose bond relationship between the child and parent object.
- There is no need for the child record to be associated with the parent.
- There is no record deletion taking place.
- There is no need for a lookup field on the page layouts.
How to create a Lookup Relationship in Salesforce?
To understand how to create a lookup relationship between the objects in Salesforce, you will need to create the objects followed by the relationship.
Below is the step by step procedure to be followed.
Step-1: The user needs to navigate to the path as represented.
Setup -> Build → Create → Object → Child Object
The next step is to build the objects using the path below
Build → Create→ Objects
It's time to select the child object which is sampled here.
Become a Looker Certified professional by learning this HKR Looker Training !
Looker Training
- Master Your Craft
- Lifetime LMS & Faculty Access
- 24/7 online expert support
- Real-world & Project Based Learning
The next step is to go to the custom fields and relationships option and click on New button.
This will open up the below window.
The user needs to select the lookup relationship option as shown above and click on the next button.
Step-2: You need to navigate to the related to option and update the other object to which this object is linked or related with followed by the next button.
Step-3: In the above screenshots, visit is the child sample, and the user needs to enter the field label and field name followed by the next button.
Step-4: In this step,you will establish field level security.
The user needs to select the visible option and click on save.Step-5: Navigate to the page layout for the child object field.
Add the field and click on next button as represented below.
Step-6: Add custom related lists
On the top, click on save button which will create a lookup relationship .
Once you open up the sample object detail page, you will see that the lookup relationship is created in Salesforce.
Want to know more about Looker,visit here Looker Tutorial !
Subscribe to our YouTube channel to get new updates..!
Types of Relationships in Salesforce
In Salesforce, the relationships are a bit tricky. Based on the business case scenario, it is important that you utilize the correct relationship type to be used in the data model.
Let us discuss some of the relationships in Salesforce.
1. Lookup relationship:
A lookup relationship is referred to as a loosely coupled relationship that allows to establish connectivity with one object to another with one to many relations. In the above provided example, Asset is associated with multiple cases. If any of the cases is deleted, the asset will remain the same and vice versa.
2. Master-detail relationship:
A master-detail relationship is considered as the strongly-coupled relationship which means that if the parent record is deleted, it will be the same with the child records.
In the master-detail relationship, the parent record is allowed to control the attributes of the child record like visibility and sharing. The child record will utilize the same security setting that the parent record holds.
In the above example, you can see a list of the rooms that employees have put for the meeting purposes. Just in case, if the room is deleted, the meetings would be of no use. Both of them go away. In the master detail relationship, you will be allowed to check out a box that allows reparenting.
3. Many to many relationships:
Let us consider a scenario where you have one record that is related to many other records. The junction object should be used to avoid confusion.
In the below example, we can see that the session includes multiple speakers and also the speakers can be included in multiple sessions. Here we need to add the junction object causation speaker between both of them to handle this sort of relationship.
4. Self relationship:
Let us consider an example of self relationship with the campaign. You will be able to use the lookup field from the campaign to the parent campaign. The below examples represent how the number of child campaigns are related to the main parent campaign which is known as campaign hierarchy.
Top 30 frequently asked Looker Interview Questions !
5. External relationships:
There are two different types of lookups that exist with external objects and are represented below:
a. Indirect lookup relationship: This kind of relationship is created between an external object and Salesforce object. Let us consider the Salesforce organization is your family, then there will be objects that will be related but not into the same family. The payment record should be related through an account from an ERP system and ERP system is considered as an external object. Here we make use of an external ID to ensure that the payments must as per their accounts.
b. External lookup relationship: This kind of relationship exists between two external objects. ERP systems will be linking the payment records to bank accounts where the ERP system is an external object and the bank account as well.
6. Hierarchical relationships:
Hierarchical relationships are simple relationships and Unique ones too. This kind of relationship can be utilized only on the user object and will provide the capability to design the hierarchy of users.
Conclusion:
As Salesforce is a vast technology, utilizing these relationships is one of the common jobs of the professionals. I hope the above information has given a complete overview of the relationship that exists in Salesforce. It is your turn to implement these relationships based on the business requirements.
Related blogs:
About Author
As a senior Technical Content Writer for HKR Trainings, Gayathri has a good comprehension of the present technical innovations, which incorporates perspectives like Business Intelligence and Analytics. She conveys advanced technical ideas precisely and vividly, as conceivable to the target group, guaranteeing that the content is available to clients. She writes qualitative content in the field of Data Warehousing & ETL, Big Data Analytics, and ERP Tools. Connect me on LinkedIn.
Upcoming Looker Training Online classes
Batch starts on 13th Dec 2024 |
|
||
Batch starts on 17th Dec 2024 |
|
||
Batch starts on 21st Dec 2024 |
|
FAQ's
The lookup relationship is a loosely coupled relationship which does not include the rollup summary. It primarily does not require the parent record for the creation of the child record. The master detail relationship is a strongly coupled relationship which includes a roll up summary field. It primarily requires a parent field for the creation of the child record. The master detail field is required on the page layout in master detail relationship while the lookup fields are not required on the page layout in lookup relationship. In the master-detail relationship, there cannot be a child record without a parent whereas there can be a child record without a parent in the lookup relationship. 40 lookups are available on an object in the lookup relationship while two master details are allowed on an object in the master detail relationship.
An external lookup relationship is used for linking a custom, child or an external object to a parent object. The external ID field values present on the parent external object will be matched with the values off the external relationship field.
There are 2 different types of lookup relationships in Salesforce. They are external lookups and indirect lookups.
There can be a maximum of 40 lookups on an object.
Yes it is possible to convert a lookup relationship into master-detail relationship only if the lookup fields in the records contain a value. you can Convert master detail relationship into a lookup relationship as long as there are no roll up summary fields present in the master object