0

How to get record type Id in apex having its system DeveloperName (not a Name/Label).

UPD:

There is a similar question here https://salesforce.stackexchange.com/search?q=What+would+be+the+best+approach+to+get+the+recordtype+id but it is more general and the best answer selected may confuse searchers. This question is more specific and has a simple oneliner as a solution, which is more accurate with the current API.

2

For example you have RecordType on Account with name 'Person Account' and DeveloperName 'Person_Account'

acc.RecordTypeId = SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Person_Account').getRecordTypeId();
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.