External objects support standard lookup relationships, which use the 18-character Salesforce record IDs to associate related records with each other. However, data that’s 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.
Required Editions
External lookups and indirect lookups compare a specific field’s values on the parent object to the relationship field’s values on the child object. When values match, the records are related to each other. External lookups and indirect lookups to external objects that have composite keys aren't supported.
To create an external object relationship, create a custom field on the child object with one of the following field types. If the child is an external object, you can instead change the field type of an existing custom field to one of the following.
- Lookup Relationship
- External Lookup Relationship
- Indirect Lookup Relationship
This table summarizes the types of relationships that are available to external objects.
| Relationship | Allowed Child Objects | Allowed Parent Objects | Parent Field for Matching Records |
|---|---|---|---|
| Lookup |
Standard Custom External |
Standard Custom |
The 18-character Salesforce record ID |
| External lookup |
Standard Custom External |
External | The External ID standard field |
| Indirect lookup | External |
Standard Custom |
You select a custom field with the External
ID and Unique attributes |
- Lookup Relationship Fields on External Objects
Use a lookup relationship when the external data includes a column that identifies related Salesforce records by their 18-character IDs. - External Lookup Relationship Fields on External Objects
Use an external lookup relationship when the parent is an external object. - Indirect Lookup Relationship Fields on External Objects
Use an indirect lookup relationship when the external data doesn’t include Salesforce record IDs.