SalesOrderAllocateAction
Reserves available on-hand inventory for every line of a sales order, following FIFO logic, up to the quantity ordered, then updates the order's shipment status. Use it when a user or agent wants to allocate or commit stock to a sales order so it can be approved, picked and shipped. The allocation runs in a batch (asynchronously): the action launches the batch and returns the batch job ID, so the result can be tracked, and the resulting shipment status is available once the job finishes. Optionally, it submits each order for approval when Submit for Approval is true. It does not pick, ship, bill or purchase stock. It accepts one or more sales orders and processes them in bulk, so pass every order you want allocated in a single call. Input per order: the sales order ID, optionally whether to submit it for approval, and optionally the batch size (how many sales orders are processed per batch; it defaults to 3). Output per order: whether the allocation batch was launched, the launched batch job ID and any error message.
| Property | Value |
| Label | Fully Allocate a Sales Order |
| Category | Order and Inventory Management |
| Since | Summer 2026 |
| Read-only | No |
| Supports Agents | Yes |
| Supports Flows | Yes |
| Async Action | Yes |
| Keywords | allocate, reserve, commit, stock, inventory, sales order |
Request Parameters
| Field | Type | Label | Description | Required |
salesOrderId | Id | Sales Order ID | The Salesforce record ID of the Sales Order (Sales_Order__c) to fully allocate. Available on-hand inventory is reserved for every line of this order. It must be a valid ID of an existing sales order. This is mandatory. | Yes |
approve | Boolean | Submit for Approval | Indicates whether or not the sales order needs to be submitted for approval after it has been allocated. Set it to true to allocate and submit for approval in one step. Leave false (the default) to only allocate the stock. This is optional. | No |
batchSize | Integer | Batch Size | The number of sales orders to process together in a single batch. Larger batches process more orders per transaction but are more likely to hit Salesforce governor limits. If one order in a batch fails, the whole batch is rolled back, so a smaller size isolates failures. It defaults to 3 when not specified. This is optional. | No |
Response Parameters
| Field | Type | Label | Description | Required |
salesOrderId | Id | Sales Order ID | The ID of the sales order that was processed. It echoes the requested ID, so each result can be matched back to its request when several orders are allocated in one call. | No |
isSuccess | Boolean | Successful Batch Job | This is true when the allocation batch was launched for this order. It is false when it could not be launched (for example, the ID is invalid or the batch could not be queued). Because allocation runs asynchronously, success means the batch started, not that the order is fully allocated: check the order's shipment status once the batch job has finished. | No |
batchJobId | Id | Batch Job ID | The ID of the Async Apex Job that performs the allocation. Use it to track the batch to completion and to read the resulting shipment status afterwards. It is empty when the batch could not be launched for this order. | No |
message | String | Message | Error message explaining why the allocation batch could not be launched for this order. It is empty if the batch is successful. Surface this text to the user to explain what to fix (for example, an invalid sales order ID). | No |
|