Ensure Apex Code Works with High Scale Orders for a B2B Store

If you extended the Commerce_Domain_Checkout_CreateOrder extension point before Summer ’24, it’s possible that your Apex code doesn’t work correctly with the High Scale Orders feature enabled. You must test your existing code to make sure that it works as expected, modifying it as needed. Also, consider how the High Scale Orders feature in general can affect your Apex code.

Required Editions

View supported editions.

Which Salesforce Commerce Product Do I Have?

The High Scale Orders feature can affect your Apex code in these ways.

  • The High Scale Orders feature creates OrderSummary objects and uses those objects to create corresponding Order objects. Only fields present in the OrderSummary objects can be reflected to the corresponding Order objects. Some Order fields aren’t available as OrderSummary fields. For example, the ShippingAddress field. Therefore, the resulting Order objects created by the High Scale Orders feature don’t reflect values for the ShippingAddress field. If you’re extending the Commerce_Domain_Checkout_CreateOrder extension point, your Apex code must only manipulate Order fields that are available in both the Order and the OrderSummary objects.
  • If you’re extending the Commerce_Domain_Checkout_CreateOrder extension point, you can manipulate custom fields on Order and OrderSummary objects. Make sure that your Apex code only manipulates custom fields that are the same for both objects. For example, same names and data types.
  • When the High Scale Orders feature creates OrderSummary objects, it sets their status to Created.
  • When the High Scale Orders feature creates Order objects, it sets their status to Activated, and the status can’t be changed.
  • The High Scale Orders feature creates Order objects and OrderSummary objects in the Automated Process user context. If the High Scale Orders feature is disabled, Order object and OrderSummary objects are created using the current shopper’s context.
  • When triggering flows on the OrderSummaryCreatedEvent, the system always uses the Automated Process user context.
  • When triggering flows on Order creation events, the system uses the Automated Process user context if the High Scale Orders feature is enabled. Otherwise, the system uses the current shopper’s context.