Fix IsDeleted
The CopyStorm/Medic Fix IsDeleted tool identifies records that have been deleted in Salesforce, removed from the Salesforce recycle bin, but not marked as deleted in CopyStorm.
This situation occurs 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.
Under normal circumstances, when a user deletes a record in Salesforce the record is not really deleted immediately. Instead, it is placed in the Salesforce recycle bin. The mechanism used by Salesforce is a hidden field named “isDeleted”. When CopyStorm runs it copies all modified records — including those where the “isDeleted” flag is set to true. After records are copied by CopyStorm, they are optionally deleted in the CopyStorm database based on parameters set on the Advanced tab.
If normal Salesforce accounts are not permitted to empty their recycle bin (a good practice) then the condition that needs this tool will likely not occur.
Running Fix IsDeleted in a GUI
The UI for the Fix IsDeleted tool contains three parts:
- The side of the dialog is used to select the tables to scan.
- The top part of the dialog has parameters that determine if problem records should be fixed.
- The lower part of the dialog displays the progress of a scan as it happens.

Running Fix IsDeleted as a Batch Job
The Fix IsDeleted tool can be run as a batch job using the following syntax:
- Windows
- CopyStormMedic.bat -tool fixDeleted -run configFile.copyStormMedic
- Linux
- sh CopyStormMedic.sh -tool fixDeleted -run configFile.copyStormMedic
Viewing Identified Problem Records
By checking the “Show Problems” checkbox, the application will store a list of all record IDs that are identified as being nonexistent (deleted) in Salesforce. To view the record IDs, run the tool, and after it is completed click the the “Show Records” button. This will open up a modal window displaying the Table name, and Salesforce Record ID of all the records that were identified by the tool.
The “Show Problems” setting can be used to validate the data prior to anything being deleted. To use it in this way, ensure that “Show Problems” is enabled, and “Fix Problems” is disabled. With this configuration, the tool will search for and identify problem records, and generate a list of IDs that can then be used to query the backup database to validate data prior to deletion, or for use in identifying mistakenly deleted records in Salesforce.
In the Record viewer window, the resulting list of TableName:RecordID pairs can be exported as a .csv as well, using the “Export” button at the bottom of the modal window.
See below for an example of the record viewer window.

Viewing Identified Problem Records – When Running Via Terminal
When running the tool via command line, and using a config file which has the “Show Problems” flag enabled, the command line output of the application will include a list of all identified problem records. An example of this is shown below.
