Using
SOQL like below :
Id
contRecordTypeId = [Select id from RecordType where sObjectType =
'Contact' and 
developerName ='NameOfRecordType' ].id ; 
Using
Describe to get record Type Id without SOQL :
Id
contRecordTypeId =
Schema.SObjectType.Contact.getRecordTypeInfosByName().get('NameOfRecordType').getRecordTypeId();
 
No comments:
Post a Comment