Newer Version Available

This content describes an older version of this product. View Latest

COA_ServiceOrderRecall Class

Recall orders that you’ve submitted to Salesforce Partner Operations.

Namespace

CHANNEL_ORDERS

Usage

The COA_ServiceOrderRecall class contains a single @InvocableMethod for recalling orders that have been submitted to Salesforce Partner Operations but haven’t yet been processed. When you recall an order, it’s removed from the processing queue and isn’t activated. For annotation information, see the Apex Developer Guide.

Example

This example receives a list of service orders, recalls them, and returns a list of outputs from the recall operation.

1public static void recallOrders(List<Service_Order__c> serviceOrders){
2        List<COA_ServiceOrderRecall.COA_ServiceOrderRecallInput> serviceOrderRecallInput = new List<COA_ServiceOrderRecall.COA_ServiceOrderRecallInput>();
3
4        for(Service_Order__c serviceOrder: serviceOrders){
5            COA_ServiceOrderRecall.COA_ServiceOrderRecallInput input = new COA_ServiceOrderRecall.COA_ServiceOrderRecallInput();
6            input.serviceOrderId = serviceOrder.Id;
7            serviceOrderRecallInput.add(input);
8        }
9
10        List<COA_ServiceOrderRecall.COA_ServiceOrderRecallOutput> serviceOrderRecallOutputs = COA_ServiceOrderRecall.recall(serviceOrderRecallInput);
11        
12    for(COA_ServiceOrderRecall.COA_ServiceOrderRecallOutput serviceOrderRecallOutput: serviceOrderRecallOutputs){
13        System.debug('Service Order Id: '+serviceOrderRecallOutput.serviceOrderId);
14        System.debug('Success?: '+serviceOrderRecallOutput.isSuccess);             
15        System.debug('Response Messages: '+serviceOrderRecallOutput.responseMessages);
16    }
17}