How to Find Record Type ID in Salesforce
Understanding how to find Salesforce Record Type IDs is crucial when setting up automations, integrating systems, writing custom code, or building Flows. Using the right Record Type ID ensures your processes correctly reference the intended record types. In this guide, I’ll walk you through practical ways to locate these IDs using Salesforce’s UI, SOQL queries, Apex code, and even Excel tools.
Manual Method (UI)
The manual method works great when you need a Record Type ID quickly for one-off tasks. However, it’s not the best choice if you’re dealing with repeated automations or large-scale operations. If the result returns successful you can find the RecordTypeId in the log:
Salesforce Classic
Follow these steps to find Record Type IDs in Salesforce Classic:
- Navigate to Setup → Customize → [Object] → Record Types.
- Click on the specific Record Type you need.
- Copy the 15-character ID from the URL (e.g., id=012…).
Important Notes:
- 15-character IDs are case-sensitive.
- Avoid using this method for automation due to instability and potential errors in bulk operations.
Lightning Experience
For Salesforce Lightning, follow these steps:
- Click the gear icon → Setup → Object Manager → [Object] → Record Types.
- Select the desired Record Type label.
- Copy the 18-character ID from the URL.
Tip: If you have a 15-character ID and need the 18-character version, use Salesforce’s conversion guide.
Using SOQL Queries
Using SOQL queries is a quick and effective way to find Record Type IDs, making them ideal when handling bulk data tasks or integrations. You can easily run these queries in either the Developer Console or Workbench, whichever you prefer.
Workbench
- Navigate to Workbench.
- Log in and select Queries → SOQL Query.
- Enter the following query:
SELECT Id,Name,RecordType,RecodType.Name FROM Contact
- Run the query to see your results clearly displayed.
Developer Console
- Open the Developer Console from your Salesforce environment.
- Click on the Query Editor tab.
- Enter the SOQL query above and execute.
Here’s what each field means:
Id: The unique Record Type ID assigned by Salesforce.
Name: The label you see in the UI. It can change, so avoid relying on it for automation.
DeveloperName: A consistent and stable identifier, perfect for automation tasks.
SObjectType: The specific Salesforce object associated with the Record Type.
When setting up automations, always use DeveloperName, since it won’t change even if the UI label does.
Using Apex Describe Methods
With Apex Describe methods, you can easily get Record Type IDs without using up your SOQL query limits. This approach is particularly useful in automation scenarios such as triggers, batch Apex jobs, or Flow actions.
Retrieve ID by Developer Name (SOQL-free, available since Summer ’18)
- Click on the gear icon on the top right of the Salesforce page.
- Open the Developer Console
- In the Debug tab select Open Execute Anonymous Window:
- Insert the Apex code as the example below:
AId contactRtId = Id contactRtId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Supplier_Contact').getRecordTypeId(); System.debug(contactRtId)
- Then click execute:
- If the result returns successful you can find the RecordTypeId in the log.
Benefits:
- Does not count against SOQL governor limits (Salesforce allows a maximum of 100 SOQL queries per transaction).
- Ideal for reusable code, triggers, and batch processes.
- Supported editions: Enterprise, Performance, Unlimited, Developer.
Recommendation: Always use DeveloperName to ensure consistent results, as it remains stable regardless of UI label changes.
Optional: Working with Excel
Tools such as XL-Connector allow easy handling of Salesforce metadata within Excel. By performing simple SOQL queries, you can export Record Type details, including IDs, labels, and DeveloperNames, directly into spreadsheets. This is highly convenient for documentation, bulk updates, and maintaining records.
You can follow these steps:
- Click the Get Data option on XL-Connector:
- Then select the RecordType Object, select the fields you want to pull and click on Execute:
- After executing a table will be created with the results of the SOQL query built:
Troubleshooting Tips
If your query doesn’t return the expected results, check for these common mistakes:
- Missing or incorrect SObjectType in your query filter.
- User permissions issues, meaning your user may lack visibility to that specific Record Type.
- Using the Name label instead of DeveloperName, which can be changed, and lead to inconsistent results.
Quick tip: Try running your query in Workbench with “View All Data” permissions enabled to quickly rule out any access problems.
Final Thoughts
The right approach depends on your use case:
- Manual (UI): Perfect for occasional lookups or quick checks.
- SOQL queries: Excellent for bulk tasks, integrations, or admin work.
- Apex methods: Ideal for robust, long-term automations that avoid hitting SOQL limits.
Always stick with the DeveloperName field for reliable automation rather than labels or hardcoded IDs. Choosing tools like Workbench, Developer Console, or Excel will help you easily manage and reference Record Type IDs in Salesforce.
Xappex CRM data management solutions
Looker Studio for Salesforce
Connect Salesforce reports and queries to your Google Data Studio dashboards.
Excel Merge
Calculate advanced Excel models. Generate Excel documents based on Salesforce data. All with a single click from a Salesforce record page.