You are here:
Add Order Item Summary Action
In Salesforce Order Management, add up to 100 order product summaries to an order summary. This action creates a change order record, an order product record, and an order product summary record. It also creates any supporting adjustment, tax, and summary records.
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 Add Order Item Summary.
Set Input Values
Create record variables to use in the input. Use values from earlier in the flow to set their values. The action generates records based on those values. Remember to include all required values for each object type. For example, the order item summary record variable must include an order delivery group summary ID.
| Input Parameter | Description |
|---|---|
| Order Item Summary Input | This input is an Apex-defined variable of class runtime_commerce_oms.AddOrderItemSummaries. For information on setting up the input data, see the Usage section of this topic. The variable has one field: newItems. This field is a list of one or more Apex-defined variables of class runtime_commerce_oms.AddItem. Each of the variables includes these fields.
|
Store Output Values
| Output Parameter | Description |
|---|---|
| Order Item Summary Output | This output is an Apex-defined variable of class ConnectApi.AddOrderItemSummaryOutputRepresentation. It includes these fields. 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.
|
To set up the Order Item Summary Input:
- Use record variables to define the order product summaries, order product adjustment
line summaries, and order product tax line item summaries. Sending an Id isn’t required.
- Required fields for an order product summary:
- ListPrice (Only if Order Summary Pricebook2Id is NULL or empty)
- Name
- OrderDeliveryGroupSummaryId
- OrderSummaryId
- PricebookEntryId (Only if Order Summary Pricebook2Id is set)
- Product2Id
- Quantity
- TotalLineAmount
- UnitPrice
- TypeCode
- Type
- Required fields for an order product adjustment line summary:
- Amount
- Name
- OrderSummaryId
- Required fields for an order product tax line item summary:
- Amount
- Name
- OrderSummaryId
- TaxEffectiveDate
- Type
- Required fields for an order product summary:
- Use an assignment element to set the orderItemSummary field on a runtime_commerce_oms.AddItem variable to the order product summary record variable.
- For each adjustment to the product being added, use an assignment element to set the orderItemAdjustmentLineSummary field on a runtime_commerce_oms.AddItemAdjustment variable to the corresponding order product adjustment line summary record variable. Use assignment elements to add the order product tax line summary record variables associated with it to the orderItemTaxLineItemSummaries field on the same runtime_commerce_oms.AddItemAdjustment variable.
- Use an assignment element to add the runtime_commerce_oms.AddItemAdjustment variables to the orderItemAdjustmentLineSummaries field on the runtime_commerce_oms.AddItem variable.
- For each tax on the product being added, use an assignment element to add the corresponding order product tax line summary record variable to the orderItemTaxLineItemSummaries field on the runtime_commerce_oms.AddItem variable.
- Use an assignment element to set the reasonCode field on the runtime_commerce_oms.AddItem variable to a valid reason.
- Use an assignment element to add the runtime_commerce_oms.AddItem variable to the newItems field on a runtime_commerce_oms.AddOrderItemSummaries variable.
- Repeat steps 1 through 6 for each order product that you want to include in the action, adding the inputs to the same runtime_commerce_oms.AddOrderItemSummaries variable. You can add up to five order products at a time.
- Use the runtime_commerce_oms.AddOrderItemSummaries variable in the action input.

