Partner Order Submit API
(No longer supported and available only in version 1.39 and earlier of the Channel Order App. Migrate to the Channel Order Apex API.) Send orders to Salesforce immediately or asynchronously using the Partner Order Submit API.
In Channel Order App (COA) v2.0 and later, the Channel Order Apex API replaces the Partner Order Submit API. If you have any existing integrations with the Partner Order Submit API, migrate them to the Channel Order Apex API.
When you submit an order using sendOrder or sendOrderAsync, include an order ID or set of order IDs as the argument. For example, channel_orders.ServiceOrderProcessor.sendOrder(orderId).
Use sendOrderAsync when you want to create or update multiple orders and send them in the same transaction. See the example in this section for more details.
It’s an Apex implementation, so all Apex usage rules and limits apply. Salesforce supports only one order per call.
Use the Partner Submit API to send an order after it has been created using a valid Service Order ID. You can create Service Order and Service Order Detail records using the Channel Order App, data loading, or automated processing.
Each order must include the fields listed on the Service Order and Service Order Detail objects.
The ServiceOrderProcessor object supports the following methods.
| Name | Arguments | Description |
|---|---|---|
sendOrder | ID | Submit an order with a single ID immediately. |
sendOrder | Set of IDs | Submit an order with a set of IDs immediately. |
sendOrderAsync | ID | Submit an order with a single ID asynchronously (@future). |
sendOrderAsync | Set of IDs | Submit an order with a set of IDs asynchronously (@future). |
You can only invoke ServiceOrderProcessor one time per Apex transaction. If you pass a set of IDs to sendOrder or sendOrderAsync, the maximum set size is 5. This example uses a batch job to work around this limitation.
In this example, if you have 100 orders in Draft status, the code creates one batch job with 100 executions, because only one record is processed per execution.