Loading
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Return Order Items Action

          Return Order Items Action

          In Salesforce Order Management, process one or more return order line items belonging to a return order. This action creates a change order record for the returned items and makes the processed return order line items read-only. You can include return order fees associated with the return order line items. If you do, a change order record is created for the return fees. If a processed return order line item has a remaining expected quantity, the action creates a separate return order line item representing that quantity.

          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 Return Return Order Items.

          Set Input Values

          Use values from earlier in the flow to set the inputs.

          Input Parameter Description
          Return Order Id Reference to the return order that you want to process return order line items from.
          Return Items Input

          This input is an Apex-defined variable of class ConnectApi.ReturnItemsInputRepresentation. It has three fields.

          The returnOrderItemDeliveryCharges field is an optional list of Apex-defined variables of class ConnectApi.ReturnOrderItemDeliveryChargeInputRepresentation. Each variable includes one field:

          • returnOrderLineItemId—ID of a return order line item representing a shipping charge to return.

          The returnOrderItemFees field is an optional list of Apex-defined variables of class ConnectApi.ReturnOrderItemFeeInputRepresentation. Each variable includes these fields:

          • quantityReturned—The quantity of the ReturnOrderLineItem to process. The amount of the fee to charge is determined by multiplying the total fee amount by this value, divided by the quantityExpected. For example, if the fee amount is $10 and the quantityExpected is 2, if the quantityReturned is 1, $5 is charged. This value normally equals the quantity returned of the ReturnOrderLineItem for the returned item that the fee applies to. The value must be greater than 0. If this value plus quantityToCancel is less than the expected return quantity, the remaining quantity to be returned is added to a new ReturnOrderLineItem.
          • quantityToCancel—The quantity of the ReturnOrderLineItem to remove. This value normally equals the quantity canceled of the ReturnOrderLineItem for the returned item that the fee applies to. This value can also be used to cancel a portion of the fee. The value must be 0 or greater. If this value plus quantityReturned is less than the expected return quantity, the remaining quantity to be returned is added to a new ReturnOrderLineItem.
          • returnOrderLineItemId—ID of a return order line item representing a return fee to charge.

          The returnOrderItems field is a list of Apex-defined variables of class ConnectApi.ReturnOrderItemInputRepresentation. Each of the variables includes these fields:

          • quantityReceived—(Optional) The quantity of the return order line item that has been received. The value must be zero or greater. This value isn’t used by any standard features, but is provided for use in customizations.
          • quantityRejected—(Optional) The quantity of the return order line item that has been rejected for return. The value must be zero or greater. This value isn’t used by any standard features, but is provided for use in customizations.
          • quantityReturned—The quantity of the return order line item that has been returned. The value must be greater than zero. If this value plus quantityToCancel is less than the expected return quantity, then the remaining quantity to be returned is added to a new return order line item.
          • quantityToCancel—(Optional) The quantity of the return order line item to remove because it’s not being returned. The value must be zero or greater. If this value plus quantityReturned is less than the expected return quantity, then the remaining quantity to be returned is added to a new return order line item.
          • reasonForRejection—(Optional) The reason why the rejected quantity, if any, was rejected. This value isn’t used by any standard features, but is provided for use in customizations.
          • returnOrderLineItemId—The return order line item ID.

          Store Output Values

          Output Parameter Description
          Return Items Output

          This output is an Apex-defined variable of class ConnectApi.ReturnItemsOutputRepresentation. It has three fields.

          The changeOrderId field is the ID of the change order record created for the returned item and delivery charges. Use this change order to create a credit memo.

          The feeChangeOrderId field is the ID of the change order record created for the return fees. Use this change order to create an invoice.

          The returnLineItemSplits field is a list of Apex-defined variables of class ConnectApi.ReturnOrderItemSplitLineOutputRepresentation, which includes these fields.

          After a change order is created for a return order line item, the return order line item is read-only. If this action is used to return a partial quantity, it creates a new “split” return order line item to hold the remaining quantity to be returned. In that case, it returns the IDs of the original and split return order line items in an element of the returnLineItemSplits output list property.

          • newReturnOrderItemId—ID of the new return order line item that holds the remaining return quantity.
          • originalReturnOrderItemId—ID of the original return order line item.

          Usage

          To set up the Return Return Order Items Input:

          • Use Assignment elements to set the quantityReceived, quantityRejected, quantityReturned, quantityToCancel, reasonForRejection, and returnOrderLineItemId field values on one or more ConnectApi.ReturnOrderItemInputRepresentation variables.
          • If you want to include a delivery charge, use Assignment elements to set the returnOrderLineItemId field value on one or more ConnectApi.ReturnOrderItemDeliveryChargeInputRepresentation variables.
          • If you want to include a return fee, use Assignment elements to set the quantityReturned, quantityToCancel, and returnOrderLineItemId field values on one or more ConnectApi.ReturnOrderItemFeeInputRepresentation variables.
          • Use an Assignment element to add the ConnectApi.ReturnOrderItemInputRepresentation variables to the returnOrderItems field on a ConnectApi.ReturnItemsInputRepresentation variable.
          • Use an Assignment element to add the ConnectApi.ReturnOrderItemDeliveryChargeInputRepresentation variables to the returnOrderItemDeliveryCharges field on a ConnectApi.ReturnItemsInputRepresentation variable.
          • Use an Assignment element to add the ConnectApi.ReturnOrderItemFeeInputRepresentation variables to the returnOrderItemFees field on a ConnectApi.ReturnItemsInputRepresentation variable.
          • Use the ConnectApi.ReturnItemsInputRepresentation variable and the return order ID in the action input.
           
          Loading
          Salesforce Help | Article