I'm getting this error when I insert more than one record into an custom object that has a record-triggered Flow. Flow calls an invocable method to do parse multipicklist values. here's my invocable method:
global class GetVehicleType
{
@InvocableMethod
public static List<List<String>> getVehicleType(List<myObject__c> myObj)
{
List<List<String>> ListVehicleType = new List<List<String>>();
List<String> VehicleType = new List<String>();
for(myObject__c obj : myObj)
{
if(obj.VehicleType__c != null)
{
VehicleType.addAll(obj.VehicleType__c.split(';'));
}
}
ListVehicleType.add(VehicleType);
return ListVehicleType;
}
}
Does anyone know what am I doing wrong ? Thanks !