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.

LoyaltyActionError Class

A class that contains the errors related to the execution of a Loyalty Management action.

Namespace

LoyaltyManagement

Example

1public void creditPointsTestError(){
2   List<LoyaltyManagement.PointsInput> creditPointsList = new List<LoyaltyManagement.PointsInput>();
3   creditPointsList.add(new LoyaltyManagement.PointsInputBuilder()
4      .setLoyaltyProgramMemberId('0lMRM0000002BD12AM')
5      .setProgramName('LP01')
6      .setProgramCurrencyName('Miles')
7      .setPoints(1200)
8      .setJournalId('0lVT10000008CnlMAE')
9      .build());
10   List<LoyaltyManagement.CreditPointsOutput> creditPointActionResults = LoyaltyManagement.LoyaltyResources.creditPoints(creditPointsList);
11   System.debug('Is Succcess:'+ creditPointActionResults.get(0).isSuccess());
12   System.debug('Errors:'+ creditPointActionResults.get(0).getErrors());
13}

LoyaltyActionError Constructors

The following are constructors for LoyaltyActionError.

LoyaltyActionError(code, message)

Creates an instance of the LoyaltyManagement.LoyaltyActionError class.

Signature

public LoyaltyActionError(String code, String message)

Parameters

code
Type: String
The error code.
message
Type: String
The error message.

LoyaltyActionError Methods

The following are methods for LoyaltyActionError.

getCode()

Returns a String that contains an error code.

Signature

public String getCode()

Return Value

Type: String

getMessage()

Returns a String that contains an error description.

Signature

public String getMessage()

Return Value

Type: String