Use Managed Packages to Develop Your AgentExchange Solution
Service Order
Service Order Detail
Partner Order Submit API
OEM User License Guide
Previous Versions
Edit orders that you’ve submitted to Salesforce Partner Operations.
The COA_ServiceOrderEdit class contains a single @InvocableMethod for editing orders that have been submitted to Salesforce Partner Operations but haven’t been processed. When invoking a method defined in this class, include the CHANNEL_ORDERS namespace prefix:
1CHANNEL_ORDERS.CLASS.METHOD(ARGS)For details about namespace prefixes or the @InvocableMethod annotation, see the Apex Developer Guide.
This example receives a list of service orders that have been edited, submits them, and returns a list of outputs from the edit operation.
For brevity, the methods invoked in this example omit the CHANNEL_ORDERS namespace prefix. If you use this code in your implementation, you must include the namespace prefix.
Note
1public static void editOrders(List<Service_Order__c> serviceOrders){
2 List<COA_ServiceOrderEdit.COA_ServiceOrderEditInput> serviceOrderEditInput = new List<COA_ServiceOrderEdit.COA_ServiceOrderEditInput>();
3
4 for(Service_Order__c serviceOrder: serviceOrders){
5 COA_ServiceOrderEdit.COA_ServiceOrderEditInput input = new COA_ServiceOrderEdit.COA_ServiceOrderEditInput();
6 input.serviceOrderId = serviceOrder.Id;
7 serviceOrderEditInput.add(input);
8 }
9
10 List<COA_ServiceOrderEdit.COA_ServiceOrderEditOutput> serviceOrderEditOutputs = COA_ServiceOrderEdit.edit(serviceOrderEditInput);
11
12 for(COA_ServiceOrderEdit.COA_ServiceOrderEditOutput serviceOrderEditOutput: serviceOrderEditOutputs){
13 System.debug('Service Order Id: '+serviceOrderEditOutput.serviceOrderId);
14 System.debug('Success?: '+serviceOrderEditOutput.isSuccess);
15 System.debug('Response Messages: '+serviceOrderEditOutput.responseMessages);
16 }
17}