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.
Note

Note

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

Note

Note

The Schedule Reorganization endpoint performs data cleanup. The jobThreads parameter is not effective for this endpoint.

Resource

SCHEDULE_REORGANIZATION

Available version

55.0

Apex Request Example

String endpointName = 'SCHEDULE_REORGANIZATION';
String jobName = 'Reorg';
String salesOrg = '0001'; // Sales Organization name
<namespace>.OffPlatformCallout request = new <namespace>.OffPlatformCallout(endpointName, salesOrg);
<namespace>.OffplatformCalloutResponse response = request.execute(
    <namespace>.TransactionHandler.getTransactionIdentifier(), 
    new Map<String,String>(), 
    JSON.serialize(
        new Map<String, Object>{
            'jobname' => jobName, 
            'salesorg' => salesOrg,
            'batchchain' =>  String.format(
                'TPM_Calculation_Chain_{0}_{1}',
                new List<String>{
                    salesOrg,
                    System.now().format('YYYYMMdd_hhmmss')
                }
            ),
            'jobthreads' => 1
        }
    )
);
if (response.status != 200) {
    //Handle errors
}