You are here:
Cancel Order Item Summaries Submit Action
In Salesforce Order Management, cancel one or more order product summaries from an order summary. This action creates a change order record.
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 Submit.
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 cancel 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.SubmitCancelOutputRepresentation. 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 changeBalances field is an Apex-defined variable of class ConnectApi.ChangeItemOutputRepresentation, which includes these fields.
The changeOrderId field is the ID of the change order record created for the canceled items. Use this change order to create a credit memo. The feeChangeOrderId field is the ID of the change order record created for any cancel fees. Use this change order to create an invoice. |
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, run a Cancel Order Item Summaries Preview action before running the action. Then display its output for the user to review. When the user verifies the expected results, pass the same input to this action.

