I Want to set output values in flow from apex action.
Below mentioned im getting oppId as input values from apex class.
public class flowinputs{
@invocableVariable public String oppId;
}
But Store Output Values not showing my apex results class Quoteids, QuoteSums.
This sample pic from google Same(result in setoutputvalues) like this i want to see in my Action, in order to store the output value (in my case the Results are Quoteids,QuoteSums):
Please refer the below screenshot like this i want.
See below image output values not showing from apex class result Quoteids, QuoteSums. In set ouput values i can't able to declare new resources also.
In Flow Debug im getting my results but im not able to assign output values
Here is apex code, Im getting results, I need to get setoutputvalues from apex as collection variable.
public class checksum {
public class flowinputs{
@invocableVariable public String oppId;
}
public class results{
@invocableVariable public Decimal Quotesum;
public results(Decimal Quotesums){this.Quotesum=Quotesums;}
@invocableVariable public string Quoteid;
public results(string Quoteids){this.Quoteid=Quoteid;}
}
@invocableMethod
public static list<list<results>> countSum(list<flowinputs> requests){
list<list<results>> usd =new list<list<results>>();
list<results> ussd=new list<results>();
usd.add(ussd);
List<id> oppids = new list<Id>();
for(flowinputs request:requests)
{
oppids.add(request.oppId);
}
for(AggregateResult Qsum: [select SBQQ__Quote__r.id quoteid,SBQQ__Product__r.id prid,sum(SBQQ__Quantity__c) qunty from SBQQ__QuoteLine__c where SBQQ__Quote__r.id=: oppids group by SBQQ__Product__r.id,SBQQ__Quote__r.id]){
String accid =(String)Qsum.get('quoteid');
String acid =(String)Qsum.get('prid');
Decimal quotesums=(Decimal)Qsum.get('qunty');
// System.debug('accid' +accid);
System.debug('sum'+quotesums);
ussd.add(new results(quotesums));
ussd.add(new results(acid));
ussd.add(new results(accid));
}
return usd;
}
}
public results(string Quoteids){this.Quoteid=Quoteid;}
You should also name your inner classresults
toResult
as it contains only scalars, not collections