Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More

Differences between the 'External ID' field and the 'Unique ID' field setting

Publish Date: Jul 16, 2026
Description

Salesforce provides two related but distinct field settings: External ID and Unique ID. External ID allows a field to serve as a reference bridge to an external system (such as Oracle Financials), making records searchable and accessible via the Data Loader upsert API. Unique ID is a field-level constraint that prevents duplicate values from being saved across records. These two settings are complementary and are often used together, but serve different purposes.

Resolution

'External ID' fields

The 'External ID' field may be used to reference an ID from another, external system. This ID can server as a bridge to external systems within Salesforce.
External IDs are searchable in Salesforce and you can also use the Insert API call with the External ID to refer to records when making changes via the Data Loader.

Example use case for External IDs:
If you have an Oracle Financials system that links with Salesforce, it may be more efficient for you to refer to the Oracle ID of account records from within Salesforce. In this case, you can create an 'External ID' in Salesforce and use it to capture and display the Oracle ID for each account.

Note: You can have multiple records with the same External ID, though this it is not recommended.

'Unique ID' field setting

The 'Unique ID' field is a setting that prevents the same value from being used in multiple records for any specific field.
External IDs are often created with the 'Unique ID' setting so that the External IDs are unique to each record.


Example:
You could create a 5-character text field and set that field as a 'Unique ID'. If you enter '12345' as the value in this field, you would not be able to use '12345' as the value for that field in any other record. If you attempted to use '12345' again for another record, a message would appear stating that the value is already in use.

Async Race Conditions and DUPLICATE_EXTERNAL_ID Errors

If the 'Unique ID' field is not set duplicate records can be inserted using upsert. If the insertion happens at nearly the same time. This could be from different users, or async processes. This can result in DUPLICATE_EXTERNAL_ID errors for these records.

Example:

If the Unique ID setting is not enabled, multiple records with the same External ID value can be inserted. When async processes run in parallel, a race condition may occur, resulting in DUPLICATE_EXTERNAL_ID errors. Async methods are then having DUPLICATE_EXTERNAL_ID errors thrown as there is multiple records present.This is due to the fundamental nature of Async processing. We do recommend to use Unique with External Id. While this could result in Duplicate Value errors being thrown at the time of insertion, it would be easier to catch and handle that then the DUPLICATE_EXTERNAL_ID later.

Additional Resources

Record IDs and External IDS for External Objects in Salesforce Connect-Cross-Org Adapter

Use an External ID to set the values for audit fields

Video: How to Update Records Using the External ID with Data Loader (YouTube) — demonstrates the upsert process using External ID fields in the Salesforce Data Loader.
How to Update Records using the External ID Using Data Loader

Knowledge Article Number

000385174

 
Loading
Salesforce Help | Article