Services Credits Apex Actions
The following Apex actions are available for use with services credits. For more information about Apex actions, see the Salesforce Help.
| Category | Apex Action | Apex Class | Purpose |
|---|---|---|---|
| Services Credits | Adjust Services Credits on Milestones | ServiceCrdtsServiceActionAdjCreditsForMS |
Adjusts the services credits allocated to the specified milestones by the given amounts. |
| Services Credits | Allocate Services Credits to Milestones | ServiceCrdtsServiceActionAllocCredsForMS | Allocates services credits to milestones when milestone IDs are valid. This method returns allocation IDs. If any of the records are invalid, the allocation process fails for all the records. |
| Services Credits | Expire Services Credits Customer Purchases | ServiceCreditsServcActionExpirePurchases | Expires available services credits that remain on services credits customer purchase records where the expiry date is in the past. For each purchase ID, a result object is returned. If the expiry process is successful, the result object contains the newly created allocation ID. For any records that could not be expired, the result object contains an error message. |
Inputs and Outputs for the Adjust Services Credits on Milestones Apex Action
The Adjust Services Credits on Milestones Apex action includes the following inputs and outputs.
Inputs
The Adjust Services Credits on Milestones Apex action has the following inputs.
| Input | Required or Optional | Description |
|---|---|---|
| Adjustments | Required |
The list of individual adjustments to be made in this request. Each adjustment specifies the ID of the target milestone and the revised number of credits to be allocated to that milestone. Assign this to a variable resource with an apex-defined data type and use the ServiceCreditsMilestoneAdjustment Apex class. Ensure you select the Allow multiple values (collection) checkbox for the resource. For more information about this Apex class, see Input Apex Classes. |
Input Apex Classes
The following input Apex classes are available for use with the Adjust Services Credits on Milestones Apex action.
| Apex Class | Field | Field Description |
|---|---|---|
| pse__ServiceCreditsMilestoneAdjustment | milestoneId | The ID of the target milestone. |
| newNumberOfCredits | The revised number of credits to be allocated to the target milestone. |
Outputs
The Adjust Services Credits on Milestones Apex action has no outputs.
Inputs and Outputs for the Allocate Services Credits to Milestones Apex Action
The Allocate Services Credits to Milestones Apex action includes the following inputs and outputs.
Inputs
The Allocate Services Credits to Milestones Apex action has the following inputs.
| Input | Required or Optional | Description |
|---|---|---|
| Milestone IDs | Required | The list of milestone IDs to allocate services credits to. |
Outputs
The Allocate Services Credits to Milestones Apex action has the following outputs.
| Output | Description |
|---|---|
| Allocation IDs | The list of the services credits allocation records IDs that were created. |
Inputs and Outputs for the Expire Services Credits Customer Purchases Apex Action
The Expire Services Credits Customer Purchases Apex action includes the following inputs and outputs.
Inputs
The Expire Services Credits Customer Purchases Apex action has the following inputs.
| Input | Required or Optional | Description |
|---|---|---|
| Purchase IDs | Required | The list of IDs of services credits customer purchase records with available credits to expire. |
Outputs
The Expire Services Credits Customer Purchases Apex action has the following outputs.
| Output | Description |
|---|---|
| Expiry Result | The list of results after expiry. The result contains purchase ID, the services credits allocation record ID if one was created, or an error message if an error occurred. |