function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mayank_SareenMayank_Sareen 

lookup Relationship types- when to use exactly

Hi all ,
 
I am confused with when exactly do we use an indirect lookup, a lookup and an external lookup relationship. Why cant we use just a lookup relationship for every case.

Thanks
Mayank. 
Best Answer chosen by Mayank_Sareen
Shubham NandwanaShubham Nandwana
Hi Mayank,
Salesforce provides standard, custom and also supports external objects. 
External objects are similar to custom objects, but external object record data is stored outside your Salesforce organization. For example, perhaps you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts. (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_external_objects.htm)

External objects support standard lookup relationships, which use the 18-character Salesforce record IDs to associate related records with each other. However, data that are stored outside your Salesforce org often doesn’t contain those record IDs. Therefore, two special types of lookup relationships are available for external objects: external lookups and indirect lookups. See ”External Object Relationships” in the Salesforce Help for details.

External lookup relationship
External lookup relationship links a child standard, custom, or external object to a parent external object. The values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.
In External lookup relationship, External Object will be the parent.

Indirect lookup relationship
Indirect lookup relationship links a child external object to a parent standard or custom object. You select a custom unique, external ID field on the parent object to match against the child’s indirect lookup relationship field, whose values are determined by the specified External Column Name.
In Indirect lookup relationship, Salesforce standard or custom object will be the parent and External Object will be the child.

Lookup relationship
The relationship between the two internal objects is a lookup relationship. A lookup relationship essentially links two objects together so that you can “look up” one object from the related items on another object.

Please mark it as best answer if my answer helps you.
Shubham Nandwana.
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts

All Answers

Shubham NandwanaShubham Nandwana
Hi Mayank,
Salesforce provides standard, custom and also supports external objects. 
External objects are similar to custom objects, but external object record data is stored outside your Salesforce organization. For example, perhaps you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts. (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_external_objects.htm)

External objects support standard lookup relationships, which use the 18-character Salesforce record IDs to associate related records with each other. However, data that are stored outside your Salesforce org often doesn’t contain those record IDs. Therefore, two special types of lookup relationships are available for external objects: external lookups and indirect lookups. See ”External Object Relationships” in the Salesforce Help for details.

External lookup relationship
External lookup relationship links a child standard, custom, or external object to a parent external object. The values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.
In External lookup relationship, External Object will be the parent.

Indirect lookup relationship
Indirect lookup relationship links a child external object to a parent standard or custom object. You select a custom unique, external ID field on the parent object to match against the child’s indirect lookup relationship field, whose values are determined by the specified External Column Name.
In Indirect lookup relationship, Salesforce standard or custom object will be the parent and External Object will be the child.

Lookup relationship
The relationship between the two internal objects is a lookup relationship. A lookup relationship essentially links two objects together so that you can “look up” one object from the related items on another object.

Please mark it as best answer if my answer helps you.
Shubham Nandwana.
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts
This was selected as the best answer
prayank sahu 7prayank sahu 7
Please go through the below links for more detail about relationship in salesforce

https://youtu.be/9ltnHYQ1tqE
https://youtu.be/3ULokr4yaEE