Monday, October 29, 2018

Way to get complete RecordType Information (like DeveloperName) using describe

In summer'18 release, new methods have been introduced through which we can retrieve all recordtype info using describe information. Below are 2 methods introduced in summer'18:

  • Schema.DescribeSObjectResult.getRecordTypeInfosByDeveloperName()
  • Schema.RecordTypeInfo.getDeveloperName()

Suppose you want to retrieve all recordtype information for account object then use below code:

Below is console output

Hope this help!!

1 comment: