Skip to content

Instantly share code, notes, and snippets.

@leehildebrand
Created February 24, 2017 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leehildebrand/b082ce47c574d43c6592f1079841b0b6 to your computer and use it in GitHub Desktop.
Save leehildebrand/b082ce47c574d43c6592f1079841b0b6 to your computer and use it in GitHub Desktop.
Pass multiple, strongly typed parameters from Process Builder to Apex #2
public class ProcessHandlerShowOpps {
public class OpportunityParameter{
@InvocableVariable(required=true)
public Id oppId;
@InvocableVariable(required=true)
public String name;
@InvocableVariable(required=true)
public Decimal amount;
@InvocableVariable(required=true)
public Date closeDate;
}
@InvocableMethod(label='showOpps' description='Reconstitue the Opportunities being passed from Flow')
public static void showOpps(OpportunityParameter[] opportunityParameters) {
Opportunity[] opps = new Opportunity[]{};
for(OpportunityParameter opp : opportunityParameters) opps.add(new Opportunity(Id=opp.oppId,Name=opp.name,Amount=opp.amount,CloseDate=opp.closeDate));
system.debug('****** opps: '+opps);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment