Experience Salesforce
Record ID in Salesforce
What You’ll Learn
- What is Record ID in Salesforce?
- What are the Two Versions of Record IDs in Salesforce?
- Obtaining Salesforce Record IDs
A record ID in Salesforce is a unique identifier for each record within the system. Consider it like a fingerprint, ensuring no two records share the same identity. This ID is crucial in accessing, manipulating, and referencing records throughout Salesforce.
Here, we will explore the different types of Record IDs in Salesforce and how you can locate these unique IDs.
What is Record ID in Salesforce?
Every record has a globally unique identification across the org, with value in its ID field generated at the time of record creation. That Record ID value will never change, even if the record is deleted and then undeleted.
- Entering a known Record ID in the Salesforce org URL will direct you straight to the details page of that record.
- For example https://my-salesforce-instance-dev-ed.develop.lightning.force.com/<Record Id>
- The first 3 characters of an ID indicate the object type.
- For example, Accounts – 001, Contacts – 003, Leads – 00Q, etc.
- These prefixes can never be changed for objects.
- Custom objects are assigned 3-char prefixes based on internal SFDC rules that we cannot predict.
- Salesforce Record IDs are identical only in the Full Copy Sandbox and Production environments.
What are the Two Versions of Record IDs in Salesforce?
There are two primary types of record IDs in Salesforce
1. 15-Character ID
- It is referenced in the user interface.
- Case-sensitive and displayed in the user interface (URLs, reports, etc.).
- Represents the core identifier with information about the object type, server instance, and record itself.
- Example: 0012F00002h5G8VQAU
2. 18-Character ID
- It is referenced through the API. The last 3 digits are the checksum of capitalizing the first 15 characters.
- Non-case-sensitive and typically found during data exports or API interactions.
- Includes the same information as the 15-character ID, with three additional characters indicating the case of each character in the original ID.
- Example: 0012F00002h5G8VQAUQAG (QAG represents the casing information)
Here’s a quick breakdown of the critical differences between 15-character ID and 18-character ID
Feature | 15-Character ID | 18-Character ID |
Length | 15 characters | 18 characters |
Case Sensitivity | Case-sensitive | Non-case-sensitive |
Location | User interface, reports | Data exports, API interactions |
Information | Object type, server instance, record | Same as above + casing information |
Display | Displays in Salesforce Classic | Displays in Salesforce Lightning version |
Note: A 15-digit ID can be converted into an 18-digit ID using CASESAFEID() function and to convert an 18-digit ID into a 15-digit ID simply remove the last 3 digits from it.
Obtaining Salesforce Record IDs
Getting your records’ distinct Salesforce-generated IDs can be essential. Adding the Record ID field to a report for a specific object is an easy way to accomplish this.
In addition, the ID can be shown on the Record Detail page or the Object’s List Views by creating a custom Formula field.
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, the 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 the upper right corner
2. Navigate to the Setup menu
3. Click the Object Manager tab
4. Select the Object to add the Record ID field. For example, Accounts to add the Account ID
5. Click Fields and Relationships on the left side of the page
6. Click New, choose Formula as the field type, and click Next
7. Provide a Name for the field, 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
Locating the Unique Record ID in Salesforce
Every record has an ID field containing a unique identification value produced at the moment of record creation, independent of the kind of entity. Even if the record is removed and subsequently restored, the Record ID value won’t ever alter.
Next TopicNeed Extra Support? Our FREE study materials have got you covered.
Our expert-prepared study materials provide the answers you need. Clear your doubts and improve your skills with detailed notes from industry professionals.