Schedule Global Account Product List

Schedules a job to update the global account product list.

Soft limits:

  • Maximum number of accounts based on AccountLoaderMaxNumberOfAccounts. Default value is 1000.

The jobthreads value of 1 is intentional for this endpoint and should remain unchanged.

Note

Resource 

1SCHEDULE_GLOBAL_ACCOUNT_PRODUCT_LIST

Available version 

55.0

Apex Request Example 

1// Logical endpoint name
2String endpointName = 'SCHEDULE_GLOBAL_ACCOUNT_PRODUCT_LIST';
3// name of the salesorg for which the API must be scheduled
4String salesOrg = '0001';
5<namespace>.OffplatformCallout callout = new <namespace>.OffplatformCallout(endpointName, salesOrg);
6// Log Transaction Id
7String txId = <namespace>.TransactionHandler.getTransactionIdentifier();
8// Account Id for which the products in the global apl should be retrieved
9Id accountId = '001B000001Q48yMIAR'; // Kroger Atlanta
10Map<String, String> urlParameters = new Map<String,String>();
11Map<String, Object> payloadParams = new Map<String, Object>();
12payloadParams.put('jobname', 'GlobalAPLUpdate');
13payloadParams.put('salesorg', salesOrg);
14payloadParams.put('accountids', new List<Id>{accountId}); // up to 1000 accounts
15payloadParams.put('refreshaccountproductlist', false); // add only new products or recalculate completely
16payloadParams.put('batchchain', 'TPM_Calculation_Chain_<timestamp>');
17payloadParams.put('jobthreads',  1);
18String payload = JSON.serialize(payloadParams);
19<namespace>.OffplatformCalloutResponse response = callout.execute(txId, urlParameters, payload);
20if (response.status != 200) {
21   // Handle error and return error info to caller
22}