External IDs and OData Entity Keys
When you access external data with the OData 2.0, 4.0, or 4.01 adapter for Salesforce Connect, the values of the External ID standard field on an external object are derived according to the entity key that’s defined in the OData service metadata document.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience (not for high-data-volume external objects) |
Available in: Developer Edition Available for an extra cost in: Enterprise, Performance, and Unlimited Editions |
Each external object has an External ID standard field. Its values uniquely identify each external object record in your org. When the external object is the parent in an external lookup relationship, the External ID standard field is used to identify the child records.
- External lookup relationship fields on child records store and display the External ID values of the parent records.
- For internal use only, Salesforce stores the External ID value of each row that’s retrieved from the external system. This behavior doesn’t apply to external objects that are associated with high-data-volume external data sources.
This list view for the Order_Detail external object displays External ID values.
Each External ID value is derived according to the entity key that’s defined in the OData service metadata document of the remote data service (OData producer). The entity key is formed from a subset of the entity type’s properties.
This excerpt from an OData service metadata document shows that the External ID values for the Order_Detail external object are derived from the OrderID and ProductID properties.
<EntityType Name="Order_Detail">
<Key>
<PropertyRef Name="OrderID"/>
<PropertyRef Name="ProductID"/>
</Key>
<Property Name="OrderID" Type="Edm.Int32" Nullable="false"/>
<Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
<Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4"/>
<Property Name="Quantity" Type="Edm.Int16" Nullable="false"/>
<Property Name="Discount" Type="Edm.Single" Nullable="false"/>
...This record detail page displays the OrderID and ProductID fields. Their values are combined to create the value of the External ID standard field.
If you enable writable external objects, determine whether the external system requires write operations to specify values for the entity keys. For example, many external systems generate values for entity keys when new external object records are created in Salesforce. If your external system requires write operations to specify values for entity keys, ensure that External ID standard field values and entity key values don’t contradict each other. For each write operation, include either the External ID standard field value or the custom field values that form the entity key, but never both.

