
Record identity: Salesforce IDs, legacy IDs and external IDs
Why every remediation begins with a stable key, the 15- and 18-character forms of the record ID, the use of Salesforce external IDs, and the role of legacy IDs.
Every remediation, migration or enrichment depends upon one question being answerable for every record: which record is this? Salesforce assigns each record an immutable identifier, but that identifier exists in two forms and is not the identifier the source system used. Three kinds of key must therefore be kept distinct.
| Key | What it is | Rule |
|---|---|---|
| Salesforce ID (15-character) | The case-sensitive form: two IDs that differ only in letter case are different records. | Don't use it in case-insensitive applications, such as a spreadsheet or a database with case-insensitive collation. |
| Salesforce ID (18-character) | The case-safe form: the 15 characters followed by a three-character checksum derived from the capitalization of the first fifteen. | Use it for every join, lookup and load. Convert 15-character values before use. |
| Legacy ID | The identifier the record carried in its source system, stored in a custom field on the Salesforce record. | Populate it on every migrated record; it is the most direct means of tracing a record to its origin and of reconciling counts. |
| External ID | A custom field marked as an external identifier, which Salesforce will use to match on upsert. | Use it for repeatable loads and for relating child records to parents without first retrieving the parent's Salesforce ID. |
How Salesforce external IDs are used in a load
An external ID does two jobs in a load: it matches records on upsert, and it relates children to their parents. Salesforce Help describes how imports match on external ID fields.
The 18-character checksum
The 18-character checksum can be computed rather than retrieved: the fifteen characters are divided into three groups of five, each group is read as a five-bit number in which an uppercase letter contributes a one, and each resulting value is encoded as a character from A–Z and then 0–5. A T-SQL implementation of this function is in general circulation and is a standard fixture of a migration database. The checksum's purpose is to make identifiers safe for tools that ignore case; it carries no other information.

Assess the data before the agents depend upon it
The first call is with the practitioners who would do the work, not a sales intermediary. The measures come first and the estimate follows.