Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

IssueVoucherInput Class

Use this class to issue a voucher to a loyalty program member. This class receives the input parameter values for the Issue Voucher action.

Namespace

LoyaltyManagement

Example

1public void issueVoucherTest(){
2   //...Create a list with LoyaltyManagement.IssueVoucherInput as a datatype
3   List<LoyaltyManagement.IssueVoucherInput> issueVoucherList = new List<LoyaltyManagement.IssueVoucherInput>();
4
5   //...Create an instance of the list object and set the input values 
6   issueVoucherList.add(new LoyaltyManagement.IssueVoucherInputBuilder().setLoyaltyProgramMemberId('0lMRM0000002BD12AM')
7      .setProgramName('LP01')
8      .setVoucherDefinitionName('V1')
9      .setVoucherCode('demoCode')
10      .setJournalId('0lVRM0000004DH22AM')
11      .build());
12
13   //...Pass the list that contains the input values to the LoyaltyResources.issueVoucher() function.
14   //...Store the output returned by the function in the IssueVoucherOutput object
15   List<LoyaltyManagement.IssueVoucherOutput> issueVoucherActionResults = LoyaltyManagement.LoyaltyResources.issueVoucher(issueVoucherList);
16   System.debug('Issue Voucher Successful Operation:'+ issueVoucherActionResults.get(0));
17}