Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Schedule SF Data Sync

Schedules a data sync from Salesforce to the off-platform database.

SF Data Sync is an off-platform framework component that enables down-sync and up-sync of objects from a Salesforce org to the CG Cloud Processing Services database. For more information on SF Data Sync, see Sync Data with CG Cloud Processing Services.

SF Data Sync is a data synchronization endpoint (not a batch calculation endpoint). The jobThreads parameter is not effective for this endpoint.

Note

Resource
1SCHEDULE_SFDATA_SYNC
Available version
55.0
Apex Request Example
1String endpointName = 'SCHEDULE_SFDATA_SYNC';
2// Below is the list of all allowed SF Objects which can be synced but is not mandatory to sync all objects.
3// We can have only one or two items from  the list below
4List<String> synchronizableObjects = new List<String> {
5    'cgcloud__Account_Extension__c',
6    'cgcloud__Account_Product_Profile__c',
7    'cgcloud__Account_Trade_Org_Hierarchy__c',
8    'cgcloud__Custom_Calendar__c',
9    'cgcloud__Custom_Period__c',
10    'cgcloud__Business_Year__c',
11    'cgcloud__KPI_Map__c',
12    'cgcloud__Product_Category_Share__c',
13    'Product2',
14    'cgcloud__Product_Hierarchy__c',
15    'cgcloud__Product_Part__c',
16    'cgcloud__Promotion_Template__c',
17    'cgcloud__Sales_Organization__c',
18    'cgcloud__System_Setting__c',
19    'cgcloud__Week_Day_Share_Profile__c',
20    'cgcloud__Condition_Search_Group__c',
21    'cgcloud__Condition_Search_Rule__c'
22};
23<namespace>.OffPlatformCallout request = new <namespace>.OffPlatformCallout(endpointName, '9999');
24Map<String, Object> requestBody = new Map<String, Object>{
25    'command' => 'SYNC', //Allowed values: SYNC | RE_SYNC => means Delta or Full synchronization
26    'trackedObjectApiNames' => synchronizableObjects // Optional property: If this 'trackedObjectApiNames' property is not not sent, all objects are synced/re-synced
27};
28<namespace>.OffplatformCalloutResponse response = request.execute(
29    <namespace>.TransactionHandler.getTransactionIdentifier(),
30    null,
31    JSON.serialize(requestBody)
32);
33if (response.status != 200) {
34    // Handle errors
35}