I am trying to access the variables sent from the Process Builder within the apex class. It says the variable accountParamter does not exist, which confused me because I declare it in the parameters of the invocable method.
public class ProcessHandlerShowAccounts {
public class AccountParameter{
@InvocableVariable(required=true)
public Id accountId;
@InvocableVariable(required=true)
public String name;
}
@InvocableMethod(label='handleNewAccounts' description='Display the results from the Process Builder')
public static void handleNewAccounts(AccountParameter [] accountParameters) {
//Variable AccountParamters does not exist
System.debug('The value for Account Id is: '+ accountParamters[0].accountId);
System.debug('The value for name is: '+ accountParamters[0].name);
}
}