Newer Version Available

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

Schedule Adhoc Promotion Calculation

Schedules one promotion for off-platform calculation in an ad-hoc transaction.

You must first register a transaction using the BEGIN_JOB_SCHEDULING_TRANSACTION request to schedule off-platform calculations.

Resource
1SCHEDULE_ADHOC_PROMOTION_CALCULATION
Available version
55.0
Request Parameters
Name Type Description Required or Optional
adhocTransactionId String ID of the adhoc transaction record. Required
salesOrg String ID of the sales org. Required
promotion Object Promotion object. Required
Apex Request Example
1// name of the salesorg for which the promotion belongs to
2String salesOrg = '0001';
3
4// Adhoc Transaction Id obtained from previous call
5String adhocTransactionId = 'xxxx-xxxx-xxxxxxxx-xxxx-xxxx';
6
7// Promotion id
8String promotionId = 'xxx000000000001';
9
10<namespace>.OffPlatformCallout callout = new <namespace>.OffPlatformCallout(
11      'SCHEDULE_ADHOC_PROMOTION_CALCULATION',
12      salesOrg
13);
14
15// Do request
16<namespace>.OffplatformCalloutResponse response = callout.execute(
17    txId,
18    new Map<String, String> { 'promotionId' => promotionId },
19    JSON.serialize(new Map<String, Object> {
20       'adhoctransactionid' => adhocTransactionId,
21       'salesorg' => salesOrg,
22       'promotion' => new <namespace>.PromotionWebServiceCall.WSRequestBodyV1(....)
23    })
24);
25
26if (response.status != 200) {
27    // Handle error
28}