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.
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
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}