Newer Version Available

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

Best Practices for PromotionPushRemoteActionExtension

This topic focuses on different types of Apex implementations to push multiple parent promotions.

For more information, see PromotionPushRemoteActionExtension Class. The type of Apex implementations are:

  • Sync Apex Snippet (legacy mode only)
  • Queueable (both new and legacy modes)
  • Future Method (new mode only)
  • Apex Batch Class (new mode only)

An Apex code snippet is provided for each Apex class.

Legacy Mode

In Summer ‘25 or earlier releases, PromotionPushRemoteActionExtension Class used only Apex Flex Queue to push promotions. This method of using Apex Flex Queue is referred to as Legacy Mode in this topic. This method continues to be available in future releases.

New Mode

In Winter ‘26 or later releases, a new method to push promotions using the PromotionPushRemoteActionExtension Apex class is introduced. To enable the new method, the PushPromotionExecutionMode system setting must be set to OffPlatform.

Sync Apex Snippet

This approach of Apex implementation uses the legacy mode to push promotions using the PromotionPushRemoteActionExtension Apex class. It demonstrates how to push multiple parent promotions from one synchronous Apex execution context.

Queueable

This approach of Apex implementation can use either the legacy mode or the new mode to push promotions using the PromotionPushRemoteActionExtension Apex class. It demonstrates how to push multiple parent promotions with a Queueable implementation. It requires implementation of an Apex class implementing Queueable and AllowsCallouts interfaces and an Apex code which schedules the queueable jobs (one job per parent promotion to push).

Implement Queueable and AllowsCallouts
Scheduling Apex Snippet

Future Method

This approach of Apex implementation uses the new mode to push promotions using the PromotionPushRemoteActionExtension Apex class. It demonstrates how to push multiple parent promotions with a Future annotated method implementation. Each call to the future annotated method schedules one parent promotion.

Scheduling Apex Snippet

Apex Batch Class

This approach of Apex implementation uses the new mode to push promotions using the PromotionPushRemoteActionExtension Apex class. It demonstrates how to push multiple parent promotions with a Batchable implementation. It requires implementation of an Apex class implementing Batchable and AllowsCallouts interfaces and an Apex code which schedules the batch job. The execute method of the batch job schedules one parent promotion push per call. It’s required to use a batch size of 1 when scheduling the batch job.

Scheduling Apex Snippet