UpdateCumulativeUsageCompletedInput Class

Use this class to update the progress made by a loyalty program member towards attaining a Cumulative type promotion. The action creates a Loyalty Program Member Promotion record if the promotion isn’t associated with the member. This class receives the input parameter values for the Update Cumulative Usage Completed action.

Namespace 

LoyaltyManagement

Example 

1public static void updateProgressForCumulativePromotionUsageTest() {
2
3   //Create a list with LoyaltyManagement.UpdateCumulativeUsageCompletedInput as a datatype
4   List<LoyaltyManagement.UpdateCumulativeUsageCompletedInput> updateCumulativeUsageCompletedInputList = 
5      new List<LoyaltyManagement.UpdateCumulativeUsageCompletedInput>();
6
7   //Create an instance of LoyaltyManagement.UpdateCumulativeUsageCompletedInput class and set the inputs
8   LoyaltyManagement.UpdateCumulativeUsageCompletedInput input = new LoyaltyManagement.UpdateCumulativeUsageCompletedInput('0lMxx00000000EXEAY', '0c8xx00000000BJAAY', 200);
9   LoyaltyManagement.UpdateCumulativeUsageCompletedInput input1 = new LoyaltyManagement.UpdateCumulativeUsageCompletedInput('0lMxx00000000G9EAI', '0c8xx00000000BJAAY', 200);
10      updateCumulativeUsageCompletedInputList.add(input);
11      updateCumulativeUsageCompletedInputList.add(input1);
12
13   //Store the output returned by the interface in an instance of the UpdateCumulativeUsageCompletedOutput object
14   List<LoyaltyManagement.UpdateCumulativeUsageCompletedOutput> results = 
15      LoyaltyManagement.LoyaltyResources.updateProgressForCumulativePromotionUsage(updateCumulativeUsageCompletedInputList);
16
17   //Return the status of the Apex call
18   System.debug('updateProgressForCumulativePromotionUsage Successful Operation:'+ results.get(0).isSuccess());
19    }

UpdateCumulativeUsageCompletedInput Constructors 

The following are constructors for UpdateCumulativeUsageCompletedInput.

UpdateCumulativeUsageCompletedInput(loyaltyProgramMemberId, promotionId, usageIncrementForCumulativePromotion) 

Creates an instance of the LoyaltyManagement.UpdateCumulativeUsageCompletedInput class.

Signature 

public UpdateCumulativeUsageCompletedInput(String loyaltyProgramMemberId, String promotionId, Integer usageIncrementForCumulativePromotion)

Parameters 

loyaltyProgramMemberId

Type: String

The ID of the loyalty program member who progress towards attaining a cumulative promotion must be updated. This is a required field.

promotionId

Type: String

The ID of the Cumulative type promotion for which member’s progress must be updated. This is a required field.

usageIncrementForCumulativePromotion

Type: Integer

The value or quantity that must be added to member’s usage towards attaining the promotion. This is a required field.