function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

error inside static fucntion

Hello,

  public static Map<Lead, List<Account>> getFn(Map<Lead, String> maptest) {
     Id temp= Account.sObjectType.getDescribe().getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

When i put this line i get below error:

Method does not exist or incorrect signature: void getRecordTypeInfosByDeveloperName() from the type Schema.DescribeSObjectResult
Best Answer chosen by Ab
Raj VakatiRaj Vakati
Change is like this
 
Id temp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

complete code
 
public static Map<Lead, List<Account>> getFn(Map<Lead, String> maptest) {
	
 	 
	 Id temp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

​​​​​​​

All Answers

ajay Duggi(Heptarc)ajay Duggi(Heptarc)
Dear SandrIne,

I think there is a error : getFn(Map<Lead, String> maptest) 
Try to check my code : getFn(Map<Lead, list<String>> maptest)

Let me know if it works.
Raj VakatiRaj Vakati
Change is like this
 
Id temp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

complete code
 
public static Map<Lead, List<Account>> getFn(Map<Lead, String> maptest) {
	
 	 
	 Id temp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

​​​​​​​
This was selected as the best answer