Last active
May 13, 2020 21:30
-
-
Save leehildebrand/2249733d3317e0ee9845d2d31932e631 to your computer and use it in GitHub Desktop.
Pass multiple, strongly typed parameters from Process Builder to Apex #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProcessHandlerShowAccounts { | |
public class AccountParameter{ | |
@InvocableVariable(required=true) | |
public Id accountId; | |
@InvocableVariable(required=true) | |
public String name; | |
} | |
@InvocableMethod(label='handleNewAccounts' | |
description='Reconstitue the Accounts being inserted based on the variables passed from Process Builder' | |
category='AccountCategory') | |
public static void handleNewAccounts(AccountParameter[] accountParameters) { | |
Account[] accounts = new Account[]{}; | |
for(AccountParameter a : accountParameters) accounts.add(new Account(Id=a.accountId,Name=a.name)); | |
system.debug('****** accounts: '+accounts); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment