You need to sign in to do that
Don't have an account?
David Gunn 17
Can't pass results back from invocableMethod in Apex class to flow through custom object
(If should be posted to the developers forum I apologize - let me know and I'll post there instead.)
I can't set up my flow to receive a return value from an invocablemethod. :(
I'm building an Apex class named Temp that contains an invocablemethod named performApproval. It returns a return code and string message through a custom object:
Can anyone explain why I can't select an existing variable? Even if I create a new variable it doesn't use it or allow me to select it.
I can't set up my flow to receive a return value from an invocablemethod. :(
I'm building an Apex class named Temp that contains an invocablemethod named performApproval. It returns a return code and string message through a custom object:
global without sharing class Temp { @InvocableMethod public static List<Apex_Result__c> performApproval(List<MyInvocableVariables> myVariablesList) { List<Apex_Result__c> resultList = new List<Apex_Result__c>(); Apex_Result__c result = new Apex_Result__c(); result.Return_Code__c = 1; result.Message__c = 'Testing'; resultList.Add(result); return resultList; } global class MyInvocableVariables { @InvocableVariable(label='Opp ID' required=true) global Id oppID; } }I call the method from a flow, and I defined an SObject collection variable named Results to receive the results of the call. However, when I attempt to specify that the method's output should go into that variable I only get the option to create a new variable:
Can anyone explain why I can't select an existing variable? Even if I create a new variable it doesn't use it or allow me to select it.
Now in my flow when I go to specify a variable to receive the output from the performApproval method I see Results (which is an SObject Collection Variable based on my custom Apex_Results__c object) in the list.
How are you doing to return resultList (line 10) which is a list whereas your fonction returns a list of list (line 3) ?
I would like do the same. My goal is to use an @InvocableMethod to pass a text as input and return a list of string as output.
Thanks a lot for your help.