---
schema_version: "1"
id: fef0123a77ab8a74ee9b33edd0c9fbe84b797b9f42428e1a18d26ff6facc4076
title: Adjust Order Item Summaries Preview Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_om_actions_adjust_ois_preview.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_om_actions_adjust_ois_preview.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 78ec6e24d5ca922e41857a44102623ad1ebe308bea84dd760cf74060af00e532
description: In Salesforce Order Management, preview the expected results of adjusting the price of one or more order product summaries on an order summary, without running 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.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# 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 running 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">This feature requires the Salesforce Order Management add-on. To purchase, contact your Salesforce account executive.</td></tr></tbody></table>

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.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:17.006802721088434%">
          <col style="width:82.99319727891157%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d295353e92">Input Parameter</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d295353e95">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Input Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d295353e92 ">
              <strong class="uicontrol">Order Summary Id</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d295353e95 ">ID of the order summary associated with the order product summaries that you
              want to preview adjusting the prices of.</td>

          </tr>
          <tr class="">
            <td data-label="Input Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d295353e92 ">
              <strong class="uicontrol">Adjust Order Product Summaries Input</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d295353e95 ">
              <p>This input is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_adjust_order_item_summary.htm" target="_blank">ConnectApi.AdjustOrderItemSummaryInputRepresentation</a>, which includes these fields:</p>
              <ul>
                <li><strong class="uicontrol">adjustItems</strong> —This field is a list of Apex-defined
                  variables of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_adjust_item.htm" target="_blank">ConnectApi.AdjustItemInputRepresentation</a>. Each of the variables includes
                  these fields:<ul>
                    <li><strong class="uicontrol">orderItemSummaryId</strong> —ID of an order product summary
                      to preview a price adjustment for.</li>

                    <li><strong class="uicontrol">description</strong> —Optional description of the
                      adjustment.</li>

                    <li><strong class="uicontrol">adjustmentType</strong> —Specifies how to calculate the
                      adjustment amount from the <strong class="uicontrol">discountValue</strong> field. It
                      can have one of these values:<a name="flow_ref_elements_om_actions_adjust_ois_preview__adjustmenttypevalues"><!-- --></a>
                      <ul id="flow_ref_elements_om_actions_adjust_ois_preview__adjustmenttypevalues">
                        <li><kbd>AmountTaxOnly</kbd>—The value of
                          <strong class="uicontrol">discountValue</strong> is the tax-only adjustment
                          only.
                        </li>

                        <li><kbd>AmountWithTax</kbd>—The value of
                          <strong class="uicontrol">discountValue</strong> is the adjustment, including
                          tax.
                        </li>

                        <li><kbd>AmountWithoutTax</kbd>—The value of
                          <strong class="uicontrol">discountValue</strong> is the adjustment, not including
                          tax. Tax is calculated on the value and added.
                        </li>

                        <li><kbd>Percentage</kbd>—The value of
                          <strong class="uicontrol">discountValue</strong> is a percentage discount. It’s
                          divided by 100, and then multiplied by the total price and total tax
                          amount of the order product summary to determine the adjustment
                          amount.
                        </li>

                        <li><kbd>ProductOnly</kbd>—The value of
                          <strong class="uicontrol">discountValue</strong> is the product-only adjustment
                          only.
                        </li>

                      </ul>
                    </li>

                    <li><strong class="uicontrol">discountValue</strong> —The value used to calculate the
                      adjustment amount, as specified by the
                      <strong class="uicontrol">adjustmentType</strong>. It must be a negative value.
                    </li>

                    <li><strong class="uicontrol">reason</strong> —Adjustment reason. The value must match one
                      of the picklist values on the Reason field of the Order Product Summary
                      Change object.</li>

                  </ul>
                </li>

                <li><strong class="uicontrol">allocatedItemsChangeOrderType</strong> —Specifies how change
                  orders would be created for order product summary quantities that are currently
                  being fulfilled, defined as QuantityAllocated - QuantityFulfilled. It can have
                  one of these values:<a name="flow_ref_elements_om_actions_adjust_ois_preview__allocatedItemsChangeOrderTypevalues"><!-- --></a>
                  <ul id="flow_ref_elements_om_actions_adjust_ois_preview__allocatedItemsChangeOrderTypevalues">
                    <li><kbd>Disallowed</kbd>—When distributing the adjustment, ignore
                      any quantities being fulfilled. If an order product summary’s entire
                      quantity is being fulfilled, return an error. This value is the
                      default.</li>

                    <li><kbd>InFulfillment</kbd>—When distributing the adjustment,
                      include quantities being fulfilled. Submitting the adjustment would create a
                      separate change order for the adjustments made to those quantities.</li>

                    <li><kbd>PreFulfillment</kbd>—When distributing the adjustment,
                      include quantities being fulfilled. Submitting the adjustment would include
                      the adjustments made to those quantities in the change order for
                      pre-fulfillment quantity adjustments.</li>

                  </ul>
                </li>

                <li><strong class="uicontrol">individualLineItemTaxAdjustments</strong>—Specifies
                  whether to create multiple lines for each tax adjustment or one line with all
                  tax adjustments. The default value is false.</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

## Store Output Values

Use output values later in the flow.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:17.513134851138354%">
          <col style="width:82.48686514886164%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d295353e267">Output Parameter</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d295353e270">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Output Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d295353e267 ">
              <strong class="uicontrol">Adjust Order Product Summary Output</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d295353e270 ">
              <p>This output is an Apex-defined variable of class <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_preview_adjust_output.htm" target="_blank">ConnectApi.AdjustOrderSummaryOutputRepresentation</a>, 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. </p>
              <p>The sign of a
                value in the <strong class="uicontrol">changeBalances</strong> field is the opposite of the
                corresponding value on a change order record. For example, a discount is a
                positive value in <strong class="uicontrol">changeBalances</strong> and a negative value on a
                change order record.</p>
              <p>The <strong class="uicontrol">orderSummaryId</strong> field is the
                ID of the order summary specified in the input.</p>
              <p>The
                <strong class="uicontrol">changeBalances</strong> field is an Apex-defined variable of class
                <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_change_item_output.htm" target="_blank">ConnectApi.ChangeItemOutputRepresentation</a>,
                which includes these fields.
              </p>
              <ul>
                <li><strong class="uicontrol">grandTotalAmount</strong> —Change to the total with tax.</li>

                <li><strong class="uicontrol">totalAdjDeliveryAmtWithTax</strong> —Change to the adjusted
                  delivery subtotal, including tax.</li>

                <li><strong class="uicontrol">totalAdjDistAmountWithTax</strong> —Change to the total order
                  adjustments, including tax.</li>

                <li><strong class="uicontrol">totalAdjProductAmtWithTax</strong> —Change to the adjusted
                  product subtotal, including tax.</li>

                <li><strong class="uicontrol">totalAdjustedDeliveryAmount</strong> —Change to the adjusted
                  delivery subtotal.</li>

                <li><strong class="uicontrol">totalAdjustedDeliveryTaxAmount</strong> —Change to the adjusted
                  delivery subtotal tax.</li>

                <li><strong class="uicontrol">totalAdjustedProductAmount</strong> —Change to the adjusted
                  product subtotal.</li>

                <li><strong class="uicontrol">totalAdjustedProductTaxAmount</strong> —Change to the adjusted
                  product subtotal tax.</li>

                <li><strong class="uicontrol">totalAdjustmentDistributedAmount</strong> —Change to the total
                  order adjustments.</li>

                <li><strong class="uicontrol">totalAdjustmentDistributedTaxAmount</strong> —Change to the
                  total order adjustments tax.</li>

                <li><strong class="uicontrol">totalAmount</strong> —Change to the pretax total.</li>

                <li><strong class="uicontrol">totalExcessFundsAmount</strong> —The amount of excess funds
                  available on the order payment summaries related to the order summary. It’s
                  equal to the captured amount that is owed as a refund but isn’t associated with
                  an invoice or credit memo. Excess funds normally occur when order products are
                  canceled before fulfillment but after payment has been captured. This situation
                  isn’t common in the US, where funds are normally authorized but not captured
                  until the fulfillment process begins. This value includes all excess funds
                  related to the order summary, not only the funds related to the current
                  action.</li>

                <li><strong class="uicontrol">totalRefundableAmount</strong> —The total amount available to be
                  refunded. It’s the sum of the excess funds and any outstanding change order
                  grand total amounts that apply to post-fulfillment changes. This value includes
                  all refundable amounts related to the order summary, not only the amount related
                  to the current action.</li>

                <li><strong class="uicontrol">totalTaxAmount</strong> —Change to the total tax.</li>

              </ul>
              <p>The <strong class="uicontrol">postFulfillmentChangeOrderId</strong> field is always null for
                a preview action.</p>
              <p>The <strong class="uicontrol">preFulfillmentChangeOrderId</strong> field is always null for a
                preview action.</p>
              <p style="margin-bottom:0;">The <strong class="uicontrol">inFulfillmentChangeOrderId</strong> field is always null for a
                preview action.</p>
            </td>

          </tr>
        </tbody>
      </table>

## 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 running the adjustment. When the user verifies the expected results, pass the same input to an Adjust Order Item Summaries Submit action.

#### See Also

- [Adjust Order Item Summaries Submit Action](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_om_actions_adjust_ois_submit.htm&release=264.0.0&type=5 "In Salesforce Order Management, adjust the price of one or more order product summaries on an order summary. You can only apply a discount, not an increase. This action creates one or more change order records.")
- [Add and Edit Elements](https://help.salesforce.com/s/articleView?id=platform.flow_build_elements.htm&release=264.0.0&type=5 "Use elements to define actions that the flow can run. When they’re on the canvas, connect them to create the order in which they run.")