• How to get RecordTypeId Based On RecordType Name In Apex Salesforce

    Published By: Venu Gutta
    Published on: Saturday 16 October 2021
    A- A+

    Get RecordTypeId Based On RecordType Name In Apex

    Get RecordTypeId Based On RecordType Name In Apex


    In many use cases, we need to check recordtype conditions in apex logic. Below is the same peace of code that gives recordtypeId of given sobject name and recordType label.

    
      String egRecordTypeID = Schema.SObjectType.Case.getRecordTypeInfosByName().get('Record Type Label').getRecordTypeId();
      

    Here we need to provide Sobject name in place of  "Case" and recordType label in place of "Record Type Label"
  • No Comment to " How to get RecordTypeId Based On RecordType Name In Apex Salesforce "