Loading

Locate the Unique ID of a Record in Salesforce

Publiseringsdato: Jul 17, 2026
Beskrivelse

Every record, regardless of entity type, has a unique identification value in its ID field, which is generated at the time of record creation. That Record ID value will never change, even if the record is deleted and then undeleted. It may be necessary to obtain the unique Salesforce-generated IDs of your records. This can be done easily by adding the Record ID field to a report for a given object. Additionally, a custom Formula field can be created to display the ID on the Record Detail page or the Object's List Views.

Add the Record ID to a Report

  1. Navigate to the Report tab and open a report for the Object you need Record IDs from.
  2. Click Edit.
  3. Under the Columns section, click Add Column and search for ID.
  4. Click the Object-specific Record ID field. For example, Account ID for the Account object.
  5. Save and Run the Report.

Add the Record ID as a Custom Formula Field

  1. Click on the Gear icon in upper right corner.
  2. Navigate to the Setup menu.
  3. Click the Object Manager tab.
  4. Select the Object you need to add the Record ID field on. For example, Accounts to add the Account ID.
  5. Click Fields and Relationships on the left side of the page.
  6. Click New and choose Formula as the field type and click Next.
  7. Provide a Name for the field and select Text and click Next.
  8. Click Insert Field and choose the Record ID. For example, in Accounts choose Account ID.
  9. Click Insert, click Next, Next, Save.

View the Record ID

From a web browser, access any record. The URL displayed in the browser address bar contains both the Salesforce instance and the Record ID.
Salesforce Classic Example: http://na1.salesforce.com/5003000000D8cuI

  • Record ID: 5003000000D8cuI
  • Instance: na1

Lightning Experience Example: https://na1.lightning.force.com/lightning/r/Case/5003000000D8cuIQAA/view?0.source=alohaHeader

  • Record ID: 5003000000D8cuIQAA
  • Instance: na1
Løsning

Record ID Formats Returned via API

Note: API access requires Enterprise Edition or Unlimited Edition.

API Versions Prior to 2.0

The ID of a record is always 15-characters and case-sensitive. It should not be compared in a case-insensitive manner.

API Versions 2.0 and Higher

The API can return either a case-sensitive or a case-insensitive ID field value.
The case-insensitive ID is identical to the 15-character case-sensitive ID, but with 3 extra characters appended to indicate the casing of each of the original 15 characters.
When inserting or updating Records, the API accepts either the 15-character case-sensitive ID or the 18-character ID with the 3 extra characters appended, being case-sensitive.
For example, a 15-character ID such as '000000000000Abc' is treated as different from '000000000000aBC' because the comparison is case-sensitive. Case-insensitive tools like Microsoft Access may incorrectly treat these two IDs as the same value, which can cause data errors.
When querying or searching records using the API, you must specify a value of "1" for the "useCaseSafeIDs" parameter to indicate that you want the API to return case-insensitive IDs. If you don't specify the "useCaseSafeIDs" parameter, you automatically receive case-sensitive IDs.

API Version 2.5

The API defaults to 18 characters on the ID (case-insensitive) and provides no option to use the 15-character case-sensitive ID explicitly.
The "Reports" tool queries the database directly and therefore returns a 15-character case-sensitive ID. Tools like the Data Loader, Demand Tools, or the Weekly Data Export service will export records with the 18-character ID.

Additional Information

Salesforce IDs are 15-character, base-62 strings. Each character can be a numeric digit (0–9), a lowercase letter (a–z), or an uppercase letter (A–Z). These 15-character IDs are case-sensitive — meaning two IDs that differ only in letter case are treated as entirely different records.
Don't use 15-character IDs in case-insensitive applications. These applications may incorrectly treat two IDs as identical when they differ only by case.
To avoid these issues, all API calls return an 18-character ID that is case-safe, meaning it is compared correctly by case-insensitive applications. The extra 3 characters at the end encode the case of the preceding 15 characters. Use 18-character IDs in all API calls when creating, editing, or deleting data.

Knowledge-artikkelnummer

000385008

 
Laster
Salesforce Help | Article