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 

NameTypeDescriptionRequired or Optional
adhocTransactionIdStringID of the adhoc transaction record.Required
salesOrgStringID of the sales org.Required
promotionObjectPromotion object.Required

Apex Request Example 

1// name of the salesorg for which the promotion belongs to
2String salesOrg = '0001';
3// Adhoc Transaction Id obtained from previous call
4String adhocTransactionId = 'xxxx-xxxx-xxxxxxxx-xxxx-xxxx';
5// Promotion id
6String promotionId = 'xxx000000000001';
7<namespace>.OffPlatformCallout callout = new <namespace>.OffPlatformCallout(
8      'SCHEDULE_ADHOC_PROMOTION_CALCULATION',
9      salesOrg
10);
11// Do request
12<namespace>.OffplatformCalloutResponse response = callout.execute(
13    txId,
14    new Map<String, String> { 'promotionId' => promotionId },
15    JSON.serialize(new Map<String, Object> {
16       'adhoctransactionid' => adhocTransactionId,
17       'salesorg' => salesOrg,
18       'promotion' => new <namespace>.PromotionWebServiceCall.WSRequestBodyV1(....)
19    })
20);
21if (response.status != 200) {
22    // Handle error
23}