I have a flow setup to pass in a collection of opportunities to process and send back a collection of opportunities. In the flow I have queried the opps, assigned them to a record collection variable and check the "Available for Output" option. However when I used the apex action in the flow, there is no option to pass the collection variable to the apex class. I am trying to understaynd why I can't pass in my record collection variable.
public class FindOpportunities {
@InvocableMethod(label='Find Opportunities')
public static List<List<Opportunity>> findOpps(List<Opportunity> oppList) {
List<Opportunity> invalidOpps = new List<Opportunity>();
for (Opportunity opp : oppList) {
if (opp.AccountId != null && opp.Account.Type != 'Customer' && opp.Account.Account_Status__c != 'Active') {
invalidOpps.add(opp);
}
}
List<List<Opportunity>> result = new List<List<Opportunity>>();
result.add(invalidOpps);
return result;
}
}
List<List<Opportunity>> oppList
and see if helps? Related