Home  >  Blog  >   Salesforce  > 

Salesforce Lookup Relationship

Rating: 5
  
 
6323
  1. Share:
Salesforce Articles

 

Salesforce lookup relationship has no relation with other records. It does not depend on any other objects, whereas a master-detail relationship has an association with other records.

Let us consider this with an example: Think of the “Agent’s Table”. It has few header data which are “Manager Assigned” and the “Agent name”. It also has more fields other than the above, for agent declaration such as “ID, First Name, Second Name”, etc. The ‘master’ Manager record holds the data of the header too. The others hold the agent declaration fields. Every other area has to connect to other master records. And the “Agent” has the master-detail relationship with the “Manager table

On the other hand, the lookup relationship is just a reference. It can be even blank or NULL. In the database, we can pull the data from particular fields based on the reference keys easily. Same way in Salesforce, the object reference is the basic segmentation in the data relationships.

What is the relationship?

Connecting different objects with each other to replicate a real-life scenario/business process is called a relationship.

How to connect objects in Salesforce?

In the following ways Salesforce connects the Objects:

  • Lookup relationship.
  • Master-detail relationship.
  • Many to many relationships.
  • Hierarchical relationship.
  • Self-relationship.

How to create Lookup Relationship in Salesforce?

Let us proceed with an example of an explanation of the relationship between “Objects”. Let us consider the manager & agent relationship in sales (For Lookup relationship).

Salesforce

Step1: Identify 2 “Objects”.

Step2: Decide on which Object the relationship should be, eg: Agent.

Note: Please follow the steps from Article: Salesforce App Development, Data Modeling in Salesforce and create necessary “Objects” including fields in it.

Step3: Decide the relation type - (eg: lookup relationship)

Step4: Create a relationship field.

 MindMajix YouTube Channel

How to create a Relationship Field?

After login to “Salesforce Org” >> Select the required app in the top right corner.

create a Relationship Field- Salesforce

After selecting the desired app (eg: relationship app), Go to “Agents” Object which is already created, and select it. To the right of the screen, we have “Quick Access Menu” >> click on it and select “Fields”. Now, we can enter a new field to it with the “New” button. 

Check Out Salesforce Tutorials

create a Relationship Field - salesforce

After Selecting “New” >> Step1: Choose the field type  >> select “Lookup Relationship” next

create a Relationship Field - salesforce

Step2: Select “Related To” (for which field the “Agent Object” should be connected for relationship). >> Select “Managers”  >> next.

create a Relationship Field

Step3: Enter the details or rename the field based on the requirement (eg: Manager Assigned) >> next.

create a Relationship Field - salesforce

Step4: In this step, the access for the profiles is granted based on the requirement.

create a Relationship Field

Step5: In this step, by default “The page layout” will be in selection (eg: Student Layout) >> next.

create a Relationship Field - salesforce

Step6: In this step, the list display for managers is added for the Object - “Agents”. We can rename the “Related List Label” - (eg: Agents List).

create a Relationship Field - salesforce

Now, add entries in the “Agents Object” where you can find the managers list to add for the particular agents. “Manager Assigned” >> click on magnifying glass for the list >> select the manager from the list >> “Save”.

create a Relationship Field - salesforce

create a Relationship Field

Now, we have a scenario in which the Managers list for only desired managers will be available to select.

salesforce

Manager Object Edit >> Search Layouts >> Lookup Dialogs >> Edit >> Manager Lookup Dialogs >> Available Fields >> Select Desired Field (Manager Field) bring it to right .

salesforce

Save

salesforce

Based on our requirement, we show the “Manager” accordingly by editing the particular field.

Steps: “Agents Object Edit” >> Lookup Filter >> Show Filter Settings >> Filter Criteria >> Select Field, Operator, Value/Field >> Filter Type >> Required / Optional >> Enable the filter >> Save.

Salesforce Lookup RelationshipSalesforce Lookup RelationshipSalesforce Lookup RelationshipSalesforce Lookup Relationship

Frequently Asked Salesforce Interview Questions & Answers

Salesforce Lookup Relationship

Now, click the “New” button in the “Agent Object” to add new records, and you can look at the changes made for only desired manager filter.

Salesforce Lookup Relationship

From the above figure, we can select “Sales Manual” >> Save. But, we can even select other manager types also by typing in the field.

Steps: Agent >> New >> Manager Assigned >> Type Required Manager Name(eg: Kaushik ) >> Save

Salesforce Lookup Relationship

By the above scenario, we can also select the managers not on the list as well.

Problems with Lookup Relationship

  • No strong binding.
  • If we add New Agent >> and do not select manager, we can save it.
  • If the Manager record is deleted, there is no impact on the agent record.

With the lookup relationship, the connection/bonding between two objects is not possible.

Explore Salesforce Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

In the next topics, we will discuss in detail about “MDR - Master-Detail Relationship”. Keep following us for more info on Salesforce Administration

Mindmajix offers different Salesforce certification training according to your desire with hands-on experience on Salesforce concepts

Salesforce Administration Training  Salesforce Lightning Training 
Salesforce Advanced Developer Training  Salesforce Developer Training 
Salesforce IoT Training  Salesforce App Builder Certification Training 
Salesforce AppExchange Training  Salesforce Service Cloud Training 
and many more.   
Join our newsletter
inbox

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
NameDates
Salesforce TrainingAug 05 to Aug 20
Salesforce TrainingAug 08 to Aug 23
Salesforce TrainingAug 12 to Aug 27
Salesforce TrainingAug 15 to Aug 30
Last updated: 04 August 2023
About Author
Remy Sharp
Arogyalokesh

Arogyalokesh is a Technical Content Writer and manages content creation on various IT platforms at Mindmajix. He is dedicated to creating useful and engaging content on Salesforce, Blockchain, Docker, SQL Server, Tangle, Jira, and few other technologies. Get in touch with him on LinkedIn and Twitter.

Recommended Courses

1 /15