Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

ccrz.ccLogicCartPlaceAsync.executeAsyncOrder

Wraps inner methods that execute during the recursive, asynchronous ccrz.ccApiCart.placeAsync calls. These methods process a subset of ccrz__E_CartItem__c records from the source ccrz__E_Cart__c and converts them to ccrz__E_OrderItem__c records.

Compatibility

This reference applies to:

Release Managed Package Version API Version
B2B Commerce for Visualforce Winter ’21 4.13 12

Signature

global virtual Map<String, Object> executeAsyncOrder(Map<String, Object>)

Inputs (Required)

This method accepts the working Map<String, Object> after the ccrz.ccLogicCartPlaceAsync.processInput method completes.

This method requires the following key in the working map:

ccrz.ccApiCart.PLACE_ASYNC_FINISH
Boolean that must be true for this method to execute.
Value Usage
true The current method execution is a recursive, asynchronous call that continues the order placement process after the initial call.
false The current method execution is the synchronous portion of the initial call that begins the order placement process.

Inputs (Optional)

If the working map includes the following key, this method evaluates it:

ccrz.ccApiCart.PRICING_FOR_ORDER_FAILED
Boolean
Value Usage
true An error occurred when pricing the cart during the previous iteration of the recursive, asynchronous call. The logic chain returns a ccrz.ccLogicCartPlaceAsync.CartPlaceAsyncException, and the ccrz.ccLogicCartPlaceAsync.updateOrderOnError method executes.

This input is used only when the ccrz.ccApiCart.ALLOW_PRICING_ON_ASYNC_ORDER input is true and the cart was repriced because its price data wasn't current.

Note

false (default) No error occurred.

Logic Performed

During each recursive, asynchronous call, this method invokes other methods of the ccrz.ccLogicCartPlaceAsync class in the following order for converting a subset of ccrz__E_CartItem__c records to corresponding ccrz__E_OrderItem__c records:

  1. checkForInvalidItems
  2. retrieveCartItems

    By default, B2B Commerce for Visualforce defines a batch size of 200 ccrz__E_CartItem__c records that represent major line items and coupons. The batch size doesn't consider how many minor line items are associated with the major line items.

    Note

  3. processCartItems, which calls into createOrderItem

    The logic chain specifies a database savepoint after the processCartItems method completes to allow for rollback when errors occur. This rollback applies only to the batch of items that the current job is processing, and not all items.

    Note

  4. processOrderGroups
  5. performDMLOnOrderItems, which calls into insertMajorItems and insertMinorOrderItems
  6. enqueueNext, which calls into enqueuePlace
  7. prepReturn

During the final recursive ccrz.ccApiCart.placeAsync call that processes the remaining ccrz__E_CartItem__c records, this method invokes the remaining methods of the ccrz.ccLogicCartPlaceAsync class in the following order:

  1. processOrderTerms
  2. closeCart
  3. createStoredPayments
  4. processSubscriptions
  5. processTransactionPayments
  6. changeOrderStatus
  7. processInvoices
  8. sendOrderConfirmation
  9. prepReturn

If any exceptions occur during asynchronous processing, the updateOrderOnError and sendOrderFail methods execute.

Note

Outputs

This method returns the working Map<String, Object> after all inner methods have completed. Refer to the individual method reference for more information about each method's outputs.