Blog

Salesforce Lookup Relationship

  • (4.0)
  • | 309 Ratings

Salesforce lookup relationship has no relation with other records. It does not depend on any other objects, whereas a master-detail relationship has the 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 others 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, object reference is the basic segmentation in the data relationships.

What is a relationship?

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

Get ahead in your career by learning Salesforce through Mindmajix Salesforce Training.

How to connect objects in Salesforce?

In the following ways Salesforce connects the Objects:

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

How to create Lookup Relationship in Salesforce?

Let us proceed with an example for explanation of the relationship between “Objects”. Let us consider 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.

Subscribe to our youtube channel to get new updates..!

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

Step4: Create relationship field.

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 new field to it with “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 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 in 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 “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

Subscribe For Free Demo

Free Demo for Corporate & Online Trainings.

Arogyalokesh
About The Author

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


DMCA.com Protection Status