Newer Version Available

This content describes an older version of this product. View Latest

LoyaltyPromotionInput Class

Use this class to retrieve active promotions that are eligible for a transaction journal. The action can process accrual or redemption transactions. This class receives the input parameter values for the Loyalty Promotion action.

Namespace

LoyaltyManagement

Example

1public static void getLoyaltyPromotionsTest() {
2   //...Create a list with 'LoyaltyManagement.LoyaltyPromotionInput' as a datatype
3   List<LoyaltyManagement.LoyaltyPromotionInput> loyaltyPromotionInputList = new List<LoyaltyManagement.LoyaltyPromotionInput>();
4
5   //...Create an instance of the list object and set the input values 
6   loyaltyPromotionInputList.add(new LoyaltyManagement.LoyaltyPromotionInput input = new LoyaltyManagement.LoyaltyPromotionInputBuilder()
7      .setJournalId('0lVRM0000004DH22AM')
8      .build());
9
10   //...Pass the list that contains the input values to the 'LoyaltyResources.getLoyaltyPromotions()' function.
11   //...Store the output returned by the function in the 'LoyaltyPromotionOutput' object
12   List<LoyaltyManagement.LoyaltyPromotionOutput> results = LoyaltyManagement.LoyaltyResources.getLoyaltyPromotions(loyaltyPromotionInputList);
13   System.debug('Get Loyalty Promotions:'+ results.get(0).isSuccess());
14}