global void allocate(List<ID> soIds, Boolean approve, Integer batchSize)
Allocate the specified sales orders. Sales orders are submitted for approval based on the approve parameter. This is all completed in a batch process, and the batch size is the number specified in the method call.
A list of sales order ids to be allocated.
A Boolean that indicates whether to submit the sales orders for approval.
The number of sales orders to include in a batch. If you make this number too large, the job will fail because the processing exceeds the Salesforce governor limits. If one salesorder in the batch fails, the entire batch is rolled back. For this reason you may want to consider a batch size of 1.
This method does not throw an exception. If there are errors they are logged in the Error Log. It is important to check the error log regularly if this method is used.
Clone a sales order. A dynamic query is used to read all of the fields defined on the Sales Order header, including custom fields added in your org. The following fields on the header are reset to their new state. Sales_Order_Date__c Status__c Sales_Order_Date__c Status__c Shipment_Status__c Approval_Date__c Fulfillment_Date__c Revision__c Deposit_Amount__c Deposit_Consumed__c Applied_Rebate_Amount__c Total_Customer_Rebate_Discount__c Billed_Status__c A dynamic query is also used to read all of the fields defined on the sales order line, including the custom fields added in your org. The following fields on the sales order line are reset to their new state. Quantity_Allocated__c Quantity_Packed__c Quantity_Shipped__c Quantity_Backordered__c Quantity_Billed__c Applied_Rebate_Amount__c Customer_Rebate_Discount__c Serial_Numbers__c Purchase_Order_Line_Item__c Original_Sales_Order_Line_Item__c
The id of the sales order to clone.
An exception indicating a problem encountered while the new sales order is being created. There may be additional information in the Error Log.