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
1SCHEDULE_PROMOTION_CALCULATION
Available version
55.0
Apex Request Example
1// Endpoint name
2String endpointName = 'SCHEDULE_PROMOTION_CALCULATION';
3// Sales Organization name
4String salesOrg = '0001';
5// 
6String jobName = '<PromotionCalculationJobName>';
7Set<Id> promosIds = new Set<Id>{'<promotionId_1>', '<promotionId_2>'};
8
9<namespace>.OffPlatformCallout callout = new <namespace>.OffPlatformCallout(
10    endpointName,
11    salesOrg
12);
13
14<namespace>.OffPlatformCalloutResponse response = callout.execute(
15    <namespace>.TransactionHandler.getTransactionIdentifier(),
16    new Map<String, String>(),
17    JSON.serialize(
18        new Map<String, Object> {
19            'jobname' => jobName,
20            'salesorg' => salesOrg,
21            'promotionids' => promosIds,
22            'batchchain' => String.format(
23                'Promotion_Batch_Transaction_{0}',
24                new List<String>{
25                    <namespace>.TransactionHandler.getTransactionIdentifier()
26                }
27            )
28        }
29    )
30);
31if (response.status != 200) {
32   // Handle error
33}