Newer Version Available
CdpBasedLoyaltyPromotionInput Class
Use this class to retrieve promotions that are eligible for a member
based on the member’s market segment. This class receives the input parameter values for
the Data Cloud based Loyalty Promotion action.
Namespace
Example
1public static void getCdpBasedLoyaltyPromotionsTest() {
2 //...Create a list with LoyaltyManagement.CdpBasedLoyaltyPromotionInput as a datatype
3 List<LoyaltyManagement.CdpBasedLoyaltyPromotionInput> loyaltyPromotionInputList = new List<LoyaltyManagement.CdpBasedLoyaltyPromotionInput>();
4
5 //...Create an instance of the list object and set the input values
6 loyaltyPromotionInputList.add(new LoyaltyManagement.CdpBasedLoyaltyPromotionInput input = new LoyaltyManagement.CdpBasedLoyaltyPromotionInputBuilder()
7 .setMemberId('0lMRM0000002BD12AM')
8 .setPromotions(new List<sObject>{'0c8R000000002MqIAI', '0c8R000000002PqIAI'})
9 .build());
10
11 //...Pass the list that contains the input values to the LoyaltyResources.getLoyaltyPromotionBasedOnSalesforceCDP() function.
12 //...Store the output returned by the function in the CdpBasedLoyaltyPromotionOutput object
13 List<LoyaltyManagement.CdpBasedLoyaltyPromotionOutput> results = LoyaltyManagement.LoyaltyResources.getLoyaltyPromotionBasedOnSalesforceCDP(loyaltyPromotionInputList);
14 System.debug('Get Cdp Based Promotions:'+ results.get(0).isSuccess());
15}