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
PardonPardon 

InvocableMethod methods do not support return type of List<List<Schema.RecordTypeInfo>>

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);
	}
}


 
Ashish DevAshish Dev
But why would you want to return from Invocable method?
PardonPardon
The goal is to present the users with a list of record types that are assigned to their profiles in a visual flow. I don't want them to see all available record types
Ashish DevAshish Dev
Best bet would be to use visualforce/lightning component page for this.