• Pardon
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm trying to create an invocable method, but I get "InvocableMethod methods do not support return type of List<List<Schema.RecordTypeInfo>>" when I try to save it. Any Ideas?
 
public class RecordTypeLookup {
    
	@InvocableMethod(label ='Get Record Types')    
    public static List<List<schema.RecordTypeInfo>> getRecordTypes(){    
    	List<List<schema.RecordTypeInfo>> wrapper = new List<List<schema.RecordTypeInfo>>();
        List<schema.RecordTypeInfo> recordTypesAvailabe = Opportunity.SObjectType.getDescribe().getRecordTypeInfos();
        List<schema.RecordTypeInfo> addRecordTypes = new list <schema.RecordTypeInfo>();
        system.debug(recordTypesAvailabe);
        for (schema.RecordTypeInfo recordTypesForProfile: recordTypesAvailabe ){
            if(recordTypesForProfile.isAvailable() && recordTypesForProfile.Name!='Master') { 
            addRecordTypes.add(recordTypesForProfile);
            }
        }
        wrapper.add(addRecordTypes);
        system.debug(wrapper);
        return(wrapper);
	}
}


 
I'm trying to create an invocable method, but I get "InvocableMethod methods do not support return type of List<List<Schema.RecordTypeInfo>>" when I try to save it. Any Ideas?
 
public class RecordTypeLookup {
    
	@InvocableMethod(label ='Get Record Types')    
    public static List<List<schema.RecordTypeInfo>> getRecordTypes(){    
    	List<List<schema.RecordTypeInfo>> wrapper = new List<List<schema.RecordTypeInfo>>();
        List<schema.RecordTypeInfo> recordTypesAvailabe = Opportunity.SObjectType.getDescribe().getRecordTypeInfos();
        List<schema.RecordTypeInfo> addRecordTypes = new list <schema.RecordTypeInfo>();
        system.debug(recordTypesAvailabe);
        for (schema.RecordTypeInfo recordTypesForProfile: recordTypesAvailabe ){
            if(recordTypesForProfile.isAvailable() && recordTypesForProfile.Name!='Master') { 
            addRecordTypes.add(recordTypesForProfile);
            }
        }
        wrapper.add(addRecordTypes);
        system.debug(wrapper);
        return(wrapper);
	}
}