External Lookup and Indirect Lookup in Salesforce: A Complete Guide

Salesforce is a powerful CRM platform, and one of its strengths lies in how objects and records relate to each other. While we often use Lookup or Master-Detail relationships between standard or custom objects, when integrating external systems with Salesforce, we need something different.

This is where External Lookup and Indirect Lookup relationships come into play.

In this blog, we’ll cover:

  • What these relationships are
  • Their differences
  • Real-world examples
  • How to set them up
  • Diagrams for clarity
  • Benefits and limitations

An External Lookup Relationship links a Salesforce object to an External Object using an External ID field on the external object.

Think of it as Salesforce saying:
“Hey, this record belongs to a record in an external system (like SAP, Oracle, or another database).”

  • Works with External Objects (objects connected via Salesforce Connect).
  • Uses the External ID field on the External Object to establish the relationship.
  • Typically used when Salesforce data needs to reference data stored outside Salesforce.

Example of External Lookup

Imagine you have:

  • Invoice (Salesforce Custom Object)
  • Payment__x (External Object from external system)

You can create an External Lookup on Invoice that points to the Payment__x External Object using its External ID.

So each Invoice record in Salesforce is linked directly to its corresponding Payment record in the external system.


An Indirect Lookup Relationship is slightly different.
It links a Salesforce object to an External Object, but instead of directly matching the External ID, it matches based on a custom field value in Salesforce that corresponds to the External ID in the external system.

Think of it as Salesforce saying:
“I don’t have a direct External ID here, but I’ll match a value from my custom field to the External Object’s External ID.”


Example of Indirect Lookup

Imagine you have:

  • Account (Standard Object in Salesforce) with a field AccountNumber
  • Payment__x (External Object) with an External ID = AccountNumber

Here:

  • You create an Indirect Lookup between Account → Payment__x.
  • Salesforce uses the AccountNumber field in Account to match with the External ID field in Payment__x.

This way, Accounts in Salesforce can be related to Payments stored outside Salesforce even if Salesforce itself doesn’t store the Payment records.


Here’s a simple representation:


FeatureExternal LookupIndirect Lookup
Works withSalesforce Object → External ObjectSalesforce Object → External Object
Matching FieldDirect External ID on External ObjectSalesforce Custom Field → External Object’s External ID
ExampleInvoice → Payment__xAccount.AccountNumber → Payment__x.ExternalID
Use CaseDirect reference to external recordsMatch records based on a field value in Salesforce

  • Enables seamless integration between Salesforce and external systems.
  • Allows referencing external data without storing it inside Salesforce.
  • Supports reporting and visibility into external systems.

  • Only available with External Objects (Salesforce Connect).
  • Performance depends on the external system’s API response time.
  • Requires additional Salesforce Connect licenses in many cases.

  • Use External Lookup when you want to link a Salesforce record directly to an external record via its External ID.
  • Use Indirect Lookup when you want to match a Salesforce field value with an external record’s External ID.

Both relationships are crucial when integrating Salesforce with external data sources, ensuring your CRM stays in sync with outside systems.


Leave a Reply

Your email address will not be published. Required fields are marked *