Getting Record Type Id in Salesforce

Getting record type using Record Type Name

Id wholeSalePartnerRecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Wholesale Partner').getRecordTypeId();

Getting record type using Record Type Developer Name

Id wholeSalePartnerRecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Wholesale_Partner').getRecordTypeId();

Published by Sandeep Kumar

He is a Salesforce Certified Application Architect having 11+ years of experience in Salesforce.

Leave a Reply