0

I am calling the @InvocableMethod from the Process Builder and @InvocableMethod method is returning the result, how can I take the result and use in Process Builder?

public class GetAccountUsingPhone {

    @InvocableMethod
    public static List<Account> getAccountsUsingPhone(List<String> phones){
        System.debug('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
        System.debug('Phone Values :: '+phones);
        List<Account> accounts = [select Id, Name, AccountNumber, Phone from Account where Phone=:phones];
        System.debug('Accounts :: '+accounts);
        return accounts;
    }
}

enter image description here

3
  • 1
    From ~2 years ago: accessing the return value of an InvocableMethod in process builder. I'm not sure if anything has changed since then.
    – martin
    May 23, 2017 at 9:19
  • @Martine - Agree. There must be updates in Process Builder, we just need to found that out. May 23, 2017 at 10:49
  • 1
    Unfortunately things have not changed AFAIK. Main reason is most likely due to being able to take whatever you would do with the return value and do it in the invokable method. since you already have to write code at that point anyway. Jut a guy on my part though
    – Eric
    May 23, 2017 at 11:44

1 Answer 1

1

I think it is not possible to get value returned by apex. Go through the link given below.return values from process flow

but you can update some of your object fields that you can use in process builder.

Not the answer you're looking for? Browse other questions tagged .