ccrz.ccLogicOrderSplitOrder.copyOrder
Copies the original order data to a new ccrz__E_Order__c record.
Compatibility
This reference applies to:
Release | Managed Package Version | API Version |
---|---|---|
B2B Commerce for Visualforce Winter ’21 | 4.13 | 12 |
B2B Commerce for Visualforce Spring ’20 | 4.12 | 11 |
B2B Commerce for Visualforce Summer ’19 | 4.11 | 10 |
B2B Commerce for Visualforce Spring ’19 | 4.10 | 9 |
B2B Commerce for Visualforce Summer ’18 | 4.9 | 8 |
Signature
global virtual Map<String, Object> copyOrder(Map<String, Object>)
Inputs (Required)
This method accepts the working Map<String, Object> from the ccrz.ccLogicOrderSplitOrder.createNewOrders method.
This method requires the following keys in the working map:
- ccrz.ccApiOrder.ADDRIDMAP
-
Map<String, Object>, where:
- Each key is the ID of a ccrz__E_ContactAddr__c record for an order's billing or shipping address.
- Each value is a Map<String, Object> represents the corresponding ccrz__E_ContactAddr__c record.
- ccrz.ccApiOrder.OLDADDRDATA
- List<Map<String, Object>>, where each Map<String, Object> describes a ccrz__E_ContactAddr__c record that the original order referenced for a billing or shipping address.
- ccrz.ccApiOrder.PARAM_OWNERID
- String that specifies the owner for the new order.
- ccrz.ccApiOrder.SPLITID
- String that specifies the criteria to split the original order by, such as seller ID.
- ccrz.ccApiOrder.SRCORD
- ccrz__E_Order__c, which specifies the original order record to copy.
Logic Performed
The ccrz.ccLogicOrderSplitOrder.createNewOrders method calls into this method for creating each new order. This method completes the following actions for each new order:
- Calls the sObject clone method to create a duplicate of the original ccrz__E_Order__c.
- Sets the following field values on the new order:
Field Value ccrz__AdjustmentReason__c null ccrz__EncryptedId__c null ccrz__OrderNumber__c null ccrz__OrderSeller__c The seller ID. ccrz__SplitParentOrder__c The ID of ccrz.ccApiOrder.SRCORD ccrz__SplitProcessed__c TRUE - Calls the ccrz.ccLogicOrderSplitOrder.setOrderOwner method for setting the new order's owner to ccrz.ccApiOrder.PARAM_OWNERID.
- Creates copies of the address data, which the ccrz.ccLogicOrderSplitOrder.insertNewOrders method assigns to the new orders.
- Sets initial values of 0.00 for the new order's amounts and charges.
Outputs
This method returns the working Map<String, Object>, and sets the following key:
- ccrz.ccApiOrder.NEWORD
- ccrz__E_Order__c for the new order, ready to insert.