Salesforce deleted records not being deleted from target database

  • 122Views
  • Last Post 15 December 2020
  • Topic Is Solved
0
votes
Gavin O'Brien posted this 11 December 2020

I have a replication package copying data from Salesforce to an Azure SQL database. Some records that were deleted in Salesforce are still showing up in the SQL database. For example, a record from custom Salesforce object "Delivery__c" with ID "a1X0P00000Ka3SoUAJ" is still appearing in the SQL database with the IsDeleted column = FALSE. When I do a SOQL search for the same record ID in Salesforce, it shows with IsDeleted = TRUE and a last modified date of 12/1/2020. Any help would be appreciated. Thank you.

Package is "Salesforce to SQL", URL https://app.skyvia.com/#/64845/packages/112703

Order By: Standard | Newest | Votes
0
votes
Mariia Zaharova posted this 14 December 2020

Hello Gavin,

 

There is an "Include Deleted" parameter in the Salesforce connection. This parameter determines whether to return deleted records from the recycled bin or not. Please note that deleted records will be returned for all the requests to Salesforce via a connection with this check box selected. See more here https://docs.skyvia.com/connectors/cloud-sources/salesforce_connections.html

 

After making changes to your Salesforce connection, we recommend you to perform full replication in order to make the copy of your cloud data in the database actual. 

 

If you encounter any issues with this, feel free to contact us.

 

Best regards,

Mariia

0
votes
Gavin O'Brien posted this 14 December 2020

Thank you for the response. I was actually hoping that records deleted from Salesforce would also be deleted from the target SQL database, rather than copying deleted records. Is that possible? Do I need to empty the Recycle Bin for that to happen?

0
votes
Mariia Zaharova posted this 15 December 2020

Hello Gavin,

 

Actually not, you do not need to empty your recycle bin. Without the "Include Deleted" option, Skyvia also processes deleted records (i.e. records are deleted from the target database in this case), however, there could be some issues in cases when the package is executed right after the deletion from Salesforce.

 

Please refer to https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/polling_for_changes.htm#topic-title

It says, that "We recommend polling no more frequently than every five minutes. There are built-in controls to prevent errant applications from invoking the data replication API calls too frequently".

 

Best regards,

Mariia

0
votes
Gavin O'Brien posted this 15 December 2020

OK, thank you. I have the replication running once a day but will try changing the time so it doesn't run during work hours when people may be deleting records. I also did a full replication to take care of the immediate issues.

Close