Created
February 24, 2017 05:12
-
-
Save leehildebrand/b082ce47c574d43c6592f1079841b0b6 to your computer and use it in GitHub Desktop.
Pass multiple, strongly typed parameters from Process Builder to Apex #2
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 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