Skip to main content

SF-0033 · Concept · Medium

What is external lookup relationship?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026

External lookup is a relationship field used with external objects (objects mapped via Salesforce Connect to data living in an external system). It links a child object to a parent external object using the parent’s standard External ID field — not by Salesforce record Id, but by the value the external system uses.

There are three external-object relationship types — knowing all three is the key to this question:

TypeChildParentMatched on
LookupInternal or externalStandard or custom Salesforce objectSalesforce Id
External LookupInternal or externalExternal objectExternal object’s standard External Id
Indirect LookupExternal objectStandard or custom Salesforce objectA custom External Id, Unique field on the Salesforce object

External lookup in detail

When you create an external lookup field:

  • The target is always an external object (one with the __x suffix)
  • The value stored in the field is the External Id of the parent record in the external system — not Salesforce’s record Id
  • At query/display time, Salesforce uses the External Id to resolve the related external row via Salesforce Connect
  • Useful when the external system is the master of the data and you need to navigate to its child rows from Salesforce

Example

You have a SQL Server table Orders mapped as Order__x external object, and another table Order_Line__x (lines, child of orders). The natural key linking them in SQL Server is OrderNumber. You’d:

  1. Mark Order__x.ExternalId (the standard external-id) as the External Id field — already done by Salesforce Connect by default.
  2. On Order_Line__x, create an External Lookup field pointing to Order__x, storing OrderNumber from the external system.
  3. Now in Salesforce you can view an Order__x record and see its Order_Line__x children in a related list — even though both tables live in SQL Server.

Indirect lookup (the mirror case)

If the parent is a regular Salesforce object but the child is an external object, use Indirect Lookup. The match happens on a custom External Id + Unique field on the Salesforce object — not on the Salesforce record Id, because the external system has no idea what Salesforce Ids are.

Example

You have Account in Salesforce keyed by Vendor_Code__c (Text, External Id, Unique). Your ERP has a Purchase_Order table referencing that same vendor code, exposed as Purchase_Order__x. On Purchase_Order__x, create an Indirect Lookup to Account, configured to match against Vendor_Code__c. Now POs in the ERP appear as related-list rows on the matching Account.

Why this matters

These three relationship types let you preserve the system of record:

  • Standard lookup → both sides in Salesforce
  • External lookup → both sides (or parent) in the external system; navigated via External Id
  • Indirect lookup → child stays in external system, parent in Salesforce; matched via a Salesforce External Id field

Without external/indirect lookups, you’d have to copy or duplicate data, which defeats the point of Salesforce Connect.

Salesforce Connect prerequisites

External lookups are only meaningful when you’ve set up a Salesforce Connect External Data Source (OData 2.0/4.0, Apex Connector, or cross-org adapter) and synced the schema to create the __x external objects.

Limits to be aware of

  • External objects don’t support triggers, workflow, or roll-up summaries
  • Reporting on external objects is restricted
  • Each query against an external object counts against OData callout limits
  • The standard External Id on an external object is read-only (managed by Salesforce Connect)
  • An external object can have up to 4 indirect lookups to standard/custom Salesforce objects

Summary

External lookup = relationship to an external object, matched on its External Id. Indirect lookup = relationship from an external object to a Salesforce object, matched on a custom External Id, Unique field.

Verified against: Salesforce Help — Relationship Fields on External Objects. Last reviewed 2026-05-17.