Last active
November 20, 2022 17:23
-
-
Save danielfreitasce/fd70fded24c3518bc497dd3fe0ab81b3 to your computer and use it in GitHub Desktop.
Get the RecordType infos - Apex Salesforce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get RecordTypeId by Developer Name | |
Id theRecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('My_RecordType_Developer_Name').getRecordTypeId(); | |
//get RecordTypeId by Name | |
Id theRecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Record Type Name').getRecordTypeId(); | |
//get RecordType Name by Id | |
String theRecordTypeName = Schema.SObjectType.Account.getRecordTypeInfosById().get('RecordTypeId').getname(); | |
//where the 'RecordTypeId' is the Id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment