public static map<id,RecordType> MapRecordtype = new Map<id,RecordType>([SELECT id, DeveloperName FROM RecordType where sobjecttype ='move__c' and 
                                       Developername in('Assignment','Draft','Domestic_Draft','LTST_Draft','MX_Domestic','MX_Domestic_draft','Termination','International_Relo','Localization','J1',

Can we write schema for above query?

  • Please do not repost questions that are essentially identical. I have closed the previous one as a duplicate of this one, as it contains a little bit more information. – David Reed Jan 23 '20 at 15:38

You need to have a look into getRecordTypeInfosByDeveloperName

Here is the sample code that fetche recordTypeId for account, where developer name of recordtype is Broker.

Map<String, Schema.RecordTypeInfo> developerNameVsRecordTypeInfos = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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