External ID

External ID is a custom field attribute in Salesforce that marks a field as containing unique record identifiers from an outside system. It is not a field type. It is a setting you check on a custom Text, Number, Email, or Auto Number field. Salesforce automatically indexes every External ID field, which makes upserts and lookups against it fast.

You’ll meet this term whenever Salesforce records need to stay in sync with another system: an ERP, a billing platform, a legacy CRM, or a marketing automation tool. The external system has its own unique IDs for accounts, contacts, or products, and External ID lets Salesforce match incoming records reliably without depending on Name or Email.

PRACTICAL EXAMPLE

A company syncs Accounts between Salesforce and NetSuite. They add a custom field NetSuite_ID__c to the Account object and check the External ID box. When the nightly job pushes 5,000 Account updates from NetSuite, the upsert call matches each row to a Salesforce record by NetSuite_ID__c. New records get created, existing ones get updated, and no Salesforce IDs are required.

Quick facts

  • Available on custom fields only: Text, Number, Email, or Auto Number. Standard fields cannot be marked as External ID.

  • Case-insensitive by default: “ABC” matches “abc” on upsert. To make matching case-sensitive, enable the Unique attribute and select “Treat ‘ABC’ and ‘abc’ as different values.”

  • Soft limit of 25 per object: Salesforce allows up to 25 External ID fields per object by default. After the limit is reached, attempting to create another External ID field returns the error: “External ID and Unique field limit exceeded.” The limit can be increased by contacting Salesforce Support.

  • Automatically indexed: SOQL queries and upserts on External ID fields stay fast even on objects with millions of records.

  • Works across relationships: External ID can also match parent-child references in a single upsert call, useful for creating child records by referencing the parent’s External ID.

Warning icon

Note

Standard Salesforce fields cannot be configured as External IDs. The External ID attribute is available only on custom fields. To use a standard field value as external Id, create a custom field, mark it as an External ID, and populate it from the standard field using Flow or Apex.

FAQ

Is External ID case sensitive?

By default, no. "ABC" and "abc" match the same record on upsert. To enable case sensitivity, check the Unique attribute when creating the field and select "Treat 'ABC' and 'abc' as different values."


Can I use a standard field as an External ID?

No. The External ID attribute is only available on custom fields (Text, Number, Email, Auto Number). The workaround: create a custom field, mark it as External ID, and copy the value from the standard field using a Flow or Apex


What data types support External ID?

Four custom field types: Text, Number, Email, and Auto Number. URL, Long Text, Picklist, and Reference fields do not support the attribute.