Loading

Locate the Unique ID of a Record in Salesforce

Publiceringsdatum: Sep 1, 2025
Beskrivning

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.

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.
 

Note from Developer Guide:

Salesforce IDs are often represented by 15-character, base-62, strings. Each of the 15 characters 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. To Salesforce, 000000000000Abc isn’t the same as 000000000000aBC.

Don’t use 15-character IDs in case-insensitive applications like Microsoft Access™. These applications incorrectly consider 000000000000Abc to be the same as 000000000000aBC.

To avoid these issues, all API calls return an 18-character ID that’s case-safe, meaning that it’s compared correctly by case-insensitive applications. The extra 3 characters at the end of the ID encode the case of the preceding 15 characters. Use 18-character IDs in all API calls when creating, editing, or deleting data.

Additional Information

View the 'ID Field Type' section of the API Developer's Guide for more detail regarding the differences between a 15 character ID and 18 character ID.

If necessary, use the "Record ID Converter" script in the "Convert Record IDs from 15 to 18 Characters" article to convert between ID formats.

Users can also use the 15 to 18 character converter here .

For more information, also review this article

A Video Tutorial can be found here.


 

Knowledge-artikelnummer

000385008

 
Laddar
Salesforce Help | Article