# do\_sync\_flag

*do\_sync\_flag* explains various status of synchronization between Source and Database and helps in **Database to Source Replication**.

*do\_sync\_flag* helps in updating **existing data** and inserting **new data in Salesforce.** (This is not applicable in case of **Cassandra DB**). The value of *do\_sync\_flag* & the description is shown in the below table.

![](https://help.mydbsync.com/docs/download/attachments/31983394/37.png?version=1\&modificationDate=1546339878000\&api=v2)

* When Salesforce to Database replication is successfully completed, *do\_sync\_flag* for all the records in the database will be ‘Y’.

![](https://help.mydbsync.com/docs/download/attachments/31983394/29.png?version=1\&modificationDate=1546339878000\&api=v2)

* If the data is edited / updated in database, it is required to edit / update the same in Salesforce too. To do this *do\_sync\_flag* value must be changed to ‘S’ along with the necessary changes to the records in database. After the replication (DB to Source) all these changes will reflect in Salesforce. \
  Example: Account sForce in Salesforce does not have Type which is already replicated in database. If the type is updated as ‘Customer – Channel’ in database, Salesforce must also be updated with the same. In order to update in Salesforce *do\_sync\_flag* value must be changed to ‘S’ and this must be saved before running the replication DB to Source. After successful run, Account sForce will have Type ‘Customer - Channel’.\ <br>
  1. Account sForce does not have Type in Salesforce.![](https://help.mydbsync.com/docs/download/attachments/31983394/30.png?version=1\&modificationDate=1546339878000\&api=v2)<br>
  2. After replication (SF to DB), *do\_sync\_flag* value for sForce Account is ‘Y’ and sfType is ‘NULL’.\
     \
     ![](https://help.mydbsync.com/docs/download/attachments/31983394/31.png?version=1\&modificationDate=1546339878000\&api=v2)<br>
  3. sfType for sForce is manually updated as ‘Customer – Channel’ in database and then *do\_sync\_flag* is manually updated as ‘S’.\
     \
     ![](https://help.mydbsync.com/docs/download/attachments/31983394/32.png?version=1\&modificationDate=1546339878000\&api=v2)<br>
  4. After running Replication (DB to Source), sForce Account in Salesforce is updated with the Type ‘Customer – Channel’.\
     \
     ![](https://help.mydbsync.com/docs/download/attachments/31983394/33.png?version=1\&modificationDate=1546339878000\&api=v2)
* If the data is deleted in Salesforce after replication (Source to DB), when the replication (Source to DB) is run for the next time, *do\_sync\_flag* value changes to ‘D’. \
  Example: Account ‘Pyramid Construction Inc.’ is deleted in Salesforce which is already replicated in database.  Account Pyramid Construction Inc. data is already available in database with *do\_sync\_flag* value ‘Y’. When the Source to DB replication is done for the next time, *do\_sync\_flag* value changes to ‘D’ by itself. This signifies that Account ‘Pyramid Construction Inc.’ does not exist in Salesforce.\ <br>
  1. After Replication (Source to DB), *do\_sync\_flag* value is ‘Y’ for the account ‘Pyramid Construction Inc.’\
     \
     ![](https://help.mydbsync.com/docs/download/attachments/31983394/34.png?version=1\&modificationDate=1546339878000\&api=v2)<br>
  2. Account ‘Pyramid Construction Inc.’ is deleted in Salesforce. \
     \
     ![](https://help.mydbsync.com/docs/download/attachments/31983394/Picture16.png?version=1\&modificationDate=1546339878000\&api=v2)<br>
  3. After Replication (Source to DB), *do\_sync\_flag* value changes to ‘D’.\
     \
     ![](https://help.mydbsync.com/docs/download/attachments/31983394/36.png?version=1\&modificationDate=1546339878000\&api=v2)

<br>
