You are here:
Adjust Order Item Summaries Preview Action
In Salesforce Order Management, preview the expected results of adjusting the price of one or more order product summaries on an order summary, without executing the adjustment. You can only apply a discount, not an increase. The output of this action contains the values that would be set on the change orders created by submitting the proposed adjustment.
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 Adjust Order Item Summaries Preview.
Set Input Values
Use values from earlier in the flow to set the inputs.
| Input Parameter | Description |
|---|---|
| Order Summary Id | ID of the order summary associated with the order product summaries that you want to preview adjusting the prices of. |
| Adjust Order Product Summaries Input | This input is an Apex-defined variable of class ConnectApi.AdjustOrderItemSummaryInputRepresentation, which includes these fields:
|
Store Output Values
Use output values later in the flow.
| Output Parameter | Description |
|---|---|
| Adjust Order Product Summary Output | This output is an Apex-defined variable of class ConnectApi.AdjustOrderSummaryOutputRepresentation, which contains the financial changes that would result from the proposed adjustment. Most of the values represent the deltas of the values on the associated order summary. 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.
The postFulfillmentChangeOrderId field is always null for a preview action. The preFulfillmentChangeOrderId field is always null for a preview action. The inFulfillmentChangeOrderId field is always null for a preview action. |
Usage
When a price adjustment is applied to an order product summary, its quantities are considered in three groups:
- Pre-fulfillment—QuantityAvailableToFulfill, which is equal to QuantityOrdered - QuantityCanceled - QuantityAllocated
- In-fulfillment—QuantityAllocated - QuantityFulfilled
- Post-fulfillment—QuantityAvailableToReturn, which is equal to QuantityFulfilled - QuantityReturnInitiated
You can apply adjustments to these groups in three different ways, controlled by the allocatedItemsChangeOrderType input property:
- Distribute the adjustment evenly between pre-fulfillment and post-fulfillment quantities. Ignore in-fulfillment quantities. Submitting the adjustment would create one change order for the adjustments to pre-fulfillment quantities and one change order for the adjustments to post-fulfillment quantities.
- Distribute the adjustment evenly between pre-fulfillment, in-fulfillment, and post-fulfillment quantities. Submitting the adjustment would create one change order for the adjustments to both pre-fulfillment and in-fulfillment quantities, and one change order for the adjustments to post-fulfillment quantities.
- Distribute the adjustment evenly between pre-fulfillment, in-fulfillment, and post-fulfillment quantities. Submitting the adjustment would create one change order for the adjustments to pre-fulfillment quantities, one change order for the adjustments to in-fulfillment quantities, and one change order for the adjustments to post-fulfillment quantities.
To set up the Adjust Order Product Summaries Input:
- Use Assignment elements to set the orderItemSummaryId, description, adjustmentType, discountValue, and reason field values on one or more ConnectApi.AdjustItemInputRepresentation variables.
- Use an Assignment element to add the ConnectApi.AdjustItemInputRepresentation variables to the changeItems field on a ConnectApi.AdjustOrderItemSummaryInputRepresentation variable.
- Use an Assignment element to set the allocatedItemsChangeOrderType field on the ConnectApi.AdjustOrderItemSummaryInputRepresentation variable.
- Use the ConnectApi.AdjustOrderItemSummaryInputRepresentation variable and the order summary ID in the action input.
In a flow for adjusting the prices of order product summaries, display the output of this action for the user to review before executing the adjustment. When the user verifies the expected results, pass the same input to an Adjust Order Item Summaries Submit action.

