Schedule Promotion Calculation

Enqueues promotion jobs for batch calculation based on the promotion IDs.
Soft limits:
  • Maximum number of promotions in a promotion loader based on PromotionLoaderMaxNumberOfPromotions. Default value is 1000.

Resource

SCHEDULE_PROMOTION_CALCULATION

Available version

55.0

Request Parameters

Name Type Description Required or Optional
jobname String Name of the job. Required
salesorg String Sales Organization name. Required
promotionids List<Id> List of promotion IDs to calculate. Required
batchchain String Unique batch chain name. Required
jobthreads Number Number of parallel workers. Default: 5. Maximum: 25 (production and full copy sandbox) / 3 (other sandboxes). Recommended: 25. Optional (but strongly recommended)

Apex Request Example

// Endpoint name
String endpointName = 'SCHEDULE_PROMOTION_CALCULATION';
// Sales Organization name
String salesOrg = '0001';
// 
String jobName = '<PromotionCalculationJobName>';
Set<Id> promosIds = new Set<Id>{'<promotionId_1>', '<promotionId_2>'};
<namespace>.OffPlatformCallout callout = new <namespace>.OffPlatformCallout(
    endpointName,
    salesOrg
);
<namespace>.OffPlatformCalloutResponse response = callout.execute(
    <namespace>.TransactionHandler.getTransactionIdentifier(),
    new Map<String, String>(),
    JSON.serialize(
        new Map<String, Object> {
            'jobname' => jobName,
            'salesorg' => salesOrg,
            'promotionids' => promosIds,
            'batchchain' => String.format(
                'Promotion_Batch_Transaction_{0}',
                new List<String>{
                    <namespace>.TransactionHandler.getTransactionIdentifier()
                }
            ),
            'jobthreads' => 25  // ⚡ ADD: Number of parallel workers (default: 5, max: 25 on production/full copy sandbox, 3 on other sandboxes)
        }
    )
);
if (response.status != 200) {
   // Handle error
}