You need to sign in to do that
Don't have an account?
MasahiroY
InvocableMethod : List<Ids> inputs and List<Id> outputs
Hi all, I'm working on the InvocableMethod with Flow. What it's supposed to deliver is put List<Id> in the apex action then return unique List<Id>. Here's the code.
Do you have any solution for this? It's pretty much generic wherever you can use inputting Ids and returning unique output Ids if this code works.
Thanks!
public class lookUpAccountAnnotation { @InvocableMethod public static List<outputParam> getAccountIds(List<inputParam> param) { Set<Id> uniqueIds = new Set<Id>(); uniqueIds.addall(param[0].inputIds); outputParam response = new outputParam(); response.outputIds.addAll(uniqueIds); List<outputParam> outputs = new List<outputParam>(); outputs.add(response); return outputs; } public class inputParam { @InvocableVariable(required=false label='AccountIDs for input') public List<Id> inputIds; } public class outputParam { @InvocableVariable(required=false label='AccountIDs for output') public List<Id> outputIds; } }With system.debug() in each variable, you can get the Ids for param and uniqueIds, but it seems it stopped by response before reaching system.debug (response)
Do you have any solution for this? It's pretty much generic wherever you can use inputting Ids and returning unique output Ids if this code works.
Thanks!
Try to check with below type of code in your class: Check out this thread as well for more insight:
https://salesforce.stackexchange.com/questions/8910/how-can-i-efficiently-generate-a-setid-from-a-listsobject-structure
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.
All Answers
Try to check with below type of code in your class: Check out this thread as well for more insight:
https://salesforce.stackexchange.com/questions/8910/how-can-i-efficiently-generate-a-setid-from-a-listsobject-structure
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.