Newer Version Available

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

Schedule Reorganization

Performs off-platform data cleanup and reorganization. Promotions in Salesforce that are deleted, inactive, or cancelled are removed from off-platform data. Additionally, softly deleted measure data is hard deleted.

It is recommended that this request must be run as the first step in the nightly batch chain.

Note

Resource
1SCHEDULE_REORGANIZATION
Available version
55.0
Apex Request Example
1String endpointName = 'SCHEDULE_REORGANIZATION';
2String jobName = 'Reorg';
3String salesOrg = '0001'; // Sales Organization name
4<namespace>.OffPlatformCallout request = new <namespace>.OffPlatformCallout(endpointName, salesOrg);
5<namespace>.OffplatformCalloutResponse response = request.execute(
6    <namespace>.TransactionHandler.getTransactionIdentifier(), 
7    new Map<String,String>(), 
8    JSON.serialize(
9        new Map<String, Object>{
10            'jobname' => jobName, 
11            'salesorg' => salesOrg,
12            'batchchain' =>  String.format(
13                'TPM_Calculation_Chain_{0}_{1}',
14                new List<String>{
15                    salesOrg,
16                    System.now().format('YYYYMMdd_hhmmss')
17                }
18            ),
19            'jobthreads' => 1
20        }
21    )
22);
23
24if (response.status != 200) {
25    //Handle errors
26}