How to Find Record Type ID in Salesforce

Published: August 1, 2025
TABLE OF CONTENTS

    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:

    1. Navigate to Setup → Customize → [Object] → Record Types.

    2. Click on the specific Record Type you need.

    3. Copy the 15-character ID from the URL (e.g., id=012…).

     

    creenshot of Salesforce Classic showing the "Supplier Contact" Record Type with the 15-character Record

    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:

    1. Click the gear icon → Setup → Object Manager → [Object] → Record Types.

    2. Select the desired Record Type label.

    3. Copy the 18-character ID from the URL.

     

    Screenshot of Salesforce Lightning showing the "Supplier Contact" Record Type with the 18-character Record Type ID highlighted in 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

    1. Navigate to Workbench.

    2. Log in and select Queries → SOQL Query.

    3. Enter the following query:
      SELECT Id,Name,RecordType,RecodType.Name FROM Contact
    4. Run the query to see your results clearly displayed.

     

    Screenshot of Workbench showing a SOQL query for Contact records, with the resulting RecordTypeId and RecordType.Name columns highlighted.

     

    Developer Console

    1. Open the Developer Console from your Salesforce environment.

    2. Click on the Query Editor tab.

    3. Enter the SOQL query above and execute.

     

    Screenshot of Salesforce Developer Console showing a SOQL query executed in the Query Editor with results displaying RecordTypeId values for Contact records.


    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)

    1. Click on the gear icon on the top right of the Salesforce page.

    2. Open the Developer Console

    3. In the Debug tab select Open Execute Anonymous Window:Screenshot of the Salesforce Developer Console with the "Debug" menu open and an arrow pointing to the "Open Execute Anonymous Window" option.
    4. Insert the Apex code as the example below:
      AId contactRtId = Id contactRtId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Supplier_Contact').getRecordTypeId();
      System.debug(contactRtId)

       

    5. Then click execute:

      Screenshot of the Salesforce Developer Console showing the Execute Anonymous window with Apex code to get a Record Type ID and the "Execute" button highlighted.

    6. If the result returns successful you can find the RecordTypeId in the log.

      Screenshot of Salesforce Developer Console showing execution log with a highlighted Record Type ID returned from anonymous Apex code.

    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:

    1. Click the Get Data option on XL-Connector:

       Screenshot of Excel with XL-Connector tab open, highlighting the “Get Data” button used to pull data from Salesforce.

    2. Then select the RecordType Object, select the fields you want to pull and click on Execute:

      Screenshot of XL-Connector's Get Data window with the RecordType object and fields selected, ready to execute a query.

    3. 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.

    Posted in
    Victor Perez
    Victor Perez
    Banner-blog-ROCKET-2024-2

    Xappex CRM data management solutions

    G-Connector for Salesforce

    Connect your Salesforce data to Google Sheets in a two-way sync.

    XL-Connector for Salesforce

    Connect and export your Salesforce data to Excel.

    Looker Studio

    Looker Studio for Salesforce

    Connect Salesforce reports and queries to your Google Data Studio dashboards.

    Excel Merge

    Excel Merge

    Calculate advanced Excel models. Generate Excel documents based on Salesforce data. All with a single click from a Salesforce record page.

    XL-Connector 365

    Connect and sync Microsoft Excel on all platforms with Salesforce.