---
schema_version: "1"
id: 55cad3672060e224721f7515586ba25483d3a9b8f9c410744f48325d6b630bc6
title: Schedule SF Data Sync
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_schedule_sfdata_sync.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_schedule_sfdata_sync.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ec89ac0ca7c532fa1754e1c4f825b84d44440f0edba27e05d330db16eae1c2b4
description: Schedules a data sync from Salesforce to the off-platform database.
---
# 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](https://help.salesforce.com/s/articleView?id=ind.tpm_foundation_sync_data_overview.htm&type=5&language=en_US).

![Note](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/images/icon_note.png)

#### Note

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

## Resource

SCHEDULE\_SFDATA\_SYNC

## Available version

55.0

## Apex Request Example

String endpointName = 'SCHEDULE\_SFDATA\_SYNC';
// Below is the list of all allowed SF Objects which can be synced but is not mandatory to sync all objects.
// We can have only one or two items from  the list below
List<String\> synchronizableObjects = new List<String\> {
    'cgcloud\_\_Account\_Extension\_\_c',
    'cgcloud\_\_Account\_Product\_Profile\_\_c',
    'cgcloud\_\_Account\_Trade\_Org\_Hierarchy\_\_c',
    'cgcloud\_\_Custom\_Calendar\_\_c',
    'cgcloud\_\_Custom\_Period\_\_c',
    'cgcloud\_\_Business\_Year\_\_c',
    'cgcloud\_\_KPI\_Map\_\_c',
    'cgcloud\_\_Product\_Category\_Share\_\_c',
    'Product2',
    'cgcloud\_\_Product\_Hierarchy\_\_c',
    'cgcloud\_\_Product\_Part\_\_c',
    'cgcloud\_\_Promotion\_Template\_\_c',
    'cgcloud\_\_Sales\_Organization\_\_c',
    'cgcloud\_\_System\_Setting\_\_c',
    'cgcloud\_\_Week\_Day\_Share\_Profile\_\_c',
    'cgcloud\_\_Condition\_Search\_Group\_\_c',
    'cgcloud\_\_Condition\_Search\_Rule\_\_c'
};
<namespace>.OffPlatformCallout request = new <namespace>.OffPlatformCallout(endpointName, '9999');
Map<String, Object\> requestBody = new Map<String, Object\>{
    'command' => 'SYNC', //Allowed values: SYNC | RE\_SYNC => means Delta or Full synchronization
    'trackedObjectApiNames' => synchronizableObjects // Optional property: If this 'trackedObjectApiNames' property is not not sent, all objects are synced/re-synced
};
<namespace>.OffplatformCalloutResponse response = request.execute(
    <namespace>.TransactionHandler.getTransactionIdentifier(),
    null,
    JSON.serialize(requestBody)
);
if (response.status != 200) {
    // Handle errors
}