You need to sign in to do that
Don't have an account?
Vandana Rattan 4
Use @invocableMethod in Flows
Hi expperts,
Need suggestions on below use case:
I have to create a button on Account Detail page to open a screen with a dropdown having names of associated Contact Roles. AccountContactRoles object is not customizable so I was thinking of creating a flow which would use an apex method defined using @invocableMethod annotation to find associated Contact Role names. Issues:
1) I created a collection variable to hold the output from the method. But I am not able to select that from Target dropdown. If I create new Collection variable I get error as "DataType of resource you entered does not match. Am I missing something here?"
2) How can dropdown (choice or dynamic choice) in a screen be populated using these values?
OR should I rather concentrate on Visualforce page?
Thanks in Advance,
Vandana
Need suggestions on below use case:
I have to create a button on Account Detail page to open a screen with a dropdown having names of associated Contact Roles. AccountContactRoles object is not customizable so I was thinking of creating a flow which would use an apex method defined using @invocableMethod annotation to find associated Contact Role names. Issues:
1) I created a collection variable to hold the output from the method. But I am not able to select that from Target dropdown. If I create new Collection variable I get error as "DataType of resource you entered does not match. Am I missing something here?"
2) How can dropdown (choice or dynamic choice) in a screen be populated using these values?
OR should I rather concentrate on Visualforce page?
Thanks in Advance,
Vandana
Thank you for the reply. I am returning a List of Strings from my apex class and trying to create an sObject of Text dataType.
We are encountering the same issue.
Did you find the solution?
If the expectation is to receive a collection you can use in the flow, you'll need to have your method return a collection of collections. In this case, if you're wanting a list of strings (List<String>), you'll want to have it return a list containing lists of strings (List<List<String>>). Here's a brief example...
For your test class, you'll need to reverse this process to get the list of strings...