You are here:
Cancel Order Item Summaries Preview Action
In Salesforce Order Management, preview the expected results of canceling one or more order product summaries from an order summary without executing the cancel. The output of this action contains the values that would be set on the change order created by submitting the proposed cancel.
Required Editions
| Available in: Lightning Experience |
| View supported editions. |
| This feature requires the Salesforce Order Management add-on. To purchase, contact your Salesforce account executive. |
In Flow Builder, add an Action element to your flow. Select the Order Management category, and search for Cancel Order Item Summaries Preview.
Set Input Values
Use values from earlier in the flow to set the inputs.
| Input Parameter | Description |
|---|---|
| Cancel Order Product Summary Items Input | This input is an Apex-defined variable of class ConnectApi.ChangeInputRepresentation. The variable has one field: changeItems. This field is a list of Apex-defined variables of class ConnectApi.ChangeItemInputRepresentation. Each variable includes these fields:
|
| Order Summary Id | Reference to the order summary that you want to preview canceling order product summaries from. |
Store Output Values
| Output Parameter | Description |
|---|---|
| Cancel Order Product Summary Output | This output is an Apex-defined variable of class ConnectApi.PreviewCancelOutputRepresentation, which contains the values that would populate a change order record for the proposed cancel. The sign of a value in the changeBalances field is the opposite of the corresponding value on a change order record. For example, a discount is a positive value in changeBalances and a negative value on a change order record. The orderSummaryId field is the ID of the order summary specified in the input. The changeBalances field is an Apex-defined variable of class ConnectApi.ChangeItemOutputRepresentation, which includes these fields.
|
Usage
To set up the Cancel Order Product Summary Items Input:
- If you want to charge fees, use Assignment elements to set the amount, amountType, description, priceBookEntryId, product2Id, and reason field values on one or more ConnectApi.ChangeItemFeeInputRepresentation variables.
- Use Assignment elements to set the orderItemSummaryId, quantity, reason, and shippingReductionFlag field values on one or more ConnectApi.ChangeItemInputRepresentation variables.
- If you’re charging fees, use Assignment elements to add the ConnectApi.ChangeItemFeeInputRepresentation variables to the changeItemFees fields on the associated ConnectApi.ChangeItemInputRepresentation variables.
- Use an Assignment element to add the ConnectApi.ChangeItemInputRepresentation variables to the changeItems field on a ConnectApi.ChangeInputRepresentation variable.
- Use the ConnectApi.ChangeInputRepresentation variable and the order summary ID in the action input.
In a flow for canceling order product summaries, display the output of this action for the user to review before executing the cancel. When the user verifies the expected results, pass the same input to a Cancel Order Item Summaries Submit action.

