How Does CopyStorm Handle Deleted Records?
CopyStorm copies both active and deleted records from Salesforce to the target database by inspecting the Salesforce recycle bin. When a deleted record is discovered its “isDeleted” column is set to true in the target database.
The retention policy for deleted records in the target database is set using the Advanced tab parameter “Delete Older Than”. Available values can range from:
- Remove deleted records immediately.
- Remove deleted records after they have been deleted in Salesforce for 7 days.
- Never remove deleted records.
|Delete Older Than||Description|
|0||Any deleted records copied from Salesforce are immediately deleted from the target database.|
|7||Deleted records are removed from the target database after they have been deleted in Salesforce for 7 days.|
|A blank value means that deleted records are never removed from the target database.|
There are also situations where a record is deleted in Salesforce but is not discovered by CopyStorm. This situation may occur when:
- A user deletes records in Salesforce and empties the recycle bin BEFORE CopyStorm has run.
- A system administrator empties the global recycle bin.
- A Salesforce API program does a hard delete on Salesforce records.
- A hard delete bypasses the Salesforce recycle bin mechanism.
- Salesforce performs a hard delete.
- There are a few tables that Salesforce hard deletes by default.
When a Salesforce record is hard-deleted it is usually wise to use the CopyStorm/Medic Fix IsDeleted tool to mark the appropriate records as deleted in the target database. For information on when and how the CopyStorm/Medic tool should be used see this best practice article.