+ Start a Discussion
Rajeev_BangRajeev_Bang 

get record type without soql on recordtype in apex

How to find record type id from without soql in aprx?
Vijay NagarathinamVijay Nagarathinam
Hi Rajeev,

Refer the below blog,

http://manojjena20.blogspot.in/2015/08/how-to-get-recordtypeid-in-apex-without.html

Thanks,
Vijay
Gaurav_SrivastavaGaurav_Srivastava
Hi Rajeev,

Try below sample code. Here API Name of object is "CustomObject__c" and object name is "CustomObject".
Id objectRecordTypeId = Schema.SObjectType.CustomObject__c.getRecordTypeInfosByName().get('CustomObject').getRecordTypeId();

Thanks,
Gaurav