How to "Delete All" Easily

Salesforce allows you to Mass Delete accounts and contacts, but only 254 at a time.  During the Trial Period there is a choice for "Delete All Data" but this option disappears once you become a full customer of Salesforce.  This is to protect users from accidentally deleting all the data. 

However there may be times at the beginning of use, where the data is still being uploaded from a previous system.  If a database has over 25,000 records, you may have to go through the following steps about 100 times.  It takes a lot of time.  Worst of all, it is extremely boring.

System Administrators of both Trial and paid subscriptions can Mass Delete data. To mass delete all data, follow the steps below:

1. Log in as an Administrator.

2. Select the following
Setup | Administration Setup | Data Management | Mass Delete Records.

Select a type of Record that you wish to Delete, such as Accounts. Review the notes that let you know what records will be deleted.

Mass Delete Activities — Delete multiple activities at one time
Mass Delete Leads — Delete multiple leads at one time
Mass Delete Accounts — Delete multiple accounts at one time
Mass Delete Contacts — Delete multiple contacts at one time
Mass Delete Cases — Delete multiple cases at one time


3. Under Step 3, enter a filter that says Account or Contact Name is Not Equal to "ZZZ" assuming there are no such records.  This means that all records will be selected.

4. Review the conditions of Steps 4 and 5, then click "Search".

5. All records that meet the criteria that you entered will be returned.   Salesforce will display 250 records at a time.

6. Scan the list to confirm that you would like to delete all of the records listed. Check the box called "Delete All" select all records, then click "Delete".

7. Repeat this process for other types of records you'd like to delete.

How to Speed Up This Process

When we have a situation where a given sequence of keystrokes must be accomplished over and over, then Aldo's Macros comes to the rescue.  We can see that once the criteria for deleting all the ZZZ records is set up, the equivalent keystrokes for the mouse movements are the same.  Macro programs specialize in replaying a given sequence of keystrokes automatically.

Although most macro programs can capture mouse movements as well, keystrokes make a much more reliable macro, since the screen can change its position, throwing the mouse pointer off track. After you set up the criteria for ZZZ, and execute it once, we are ready to record  the keystrokes for automatic replay.

Start Aldo's Macros, or a similar program, and name the macro "Salesforce Delete All" or some similar name,  Put it in to Keystroke saving mode, then in to the Record Mode. 

{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Shift}{Tab}{/shift}{Enter}{script}wait 30000{/script}{script}repeat 100{/script}

The {Tab} is to move the focus on to the words Select All
The {Enter} is to select the Select All
{Shift}{Tab} is to return to the Delete button
{wait 30000} is to wait 30000 milliseconds, or 30 seconds for Salesforce to respond
{repeat 100} is to do this macro over again, 100 times as you go on to do something else.

Now, by clicking Run Macro, you can save a lot of time.  This macro would take 100 x 30 seconds = 3000 seconds, or 50 minutes.

More Details

Here is the screen you will see, to help understand the Macro.

The major objects you will Tab to are highlighted in yellow.:  The Enter key makes the Search button begin the search.

Lookup

Mass Delete:     Accounts    Help for this Page

 


 

Step 1: Review what will happen when you mass delete your Accounts:
This screen allows you to delete a list of Accounts from Salesforce. The following data will also be deleted:
 • Account Notes
 • All Contacts associated to this Account plus all related Contact data
 • All Opportunities on Accounts
 • All Activities associated with the Accounts
 • Once data is deleted, it will be moved to the Recycle Bin.
Step 2: Recommendation prior to mass deleting:
We strongly recommend you run a report to archive your data before you continue.

It is also strongly advised to request and receive a weekly export of your data before running mass delete. The weekly export service is included with Enterprise Edition, and available for an additional cost with Professional Edition. Contact salesforce.com for more information.
Step 3: Find Accounts that match the following criteria:

Set the search conditions to further restrict the list.
For date fields, enter the value in following format: 3/11/2006
For date/time fields, enter the value in following format: 3/11/2006 9:05 AM

Step 4: Choose to delete Accounts with Closed-Won Opportunities
Step 5: Choose to delete Accounts with another owner's Opportunities
Accounts with associated cases will not be deleted.
Accounts with associated active Self-Service users will not be deleted.
Accounts with activated contracts will not be deleted.

 

After the search, you will see a list of contacts to delete.


Note: You have reached the maximum number (250) of deletable Accounts at one time. If you would like to delete more Accounts, first delete the ones below and then perform another mass delete.
 
 
select all select none
Action Account Name Account Site Billing State/Province Phone Type Owner Alias Created By Alias Last Modified By Alias
  CusaCo, Inc. / Ocean Surplus, LLC   NJ 132-918-0400   user1 user1 user1
  Cusano     160-930-4714   user1 user1 user1
Cush     112-859-2656   user1 user1 user1
  Cussatti     131-137-4090   user1 user1 user1
  Custom Power   TX 113-880-0909   user1 user1 user1
  Custom Power / Preferred Electronics Inc   NY 131-582-2080   user1 user1 user1
  Custom Power Systems   N.Y. 131-467-5328   user1 user1 user1

etc.

Further Automation

Once you have verified that the Macro works fine upon command, you can further automate the process by putting in a loop.  Be sure to put in a puse which will allow Salesforce to respond.

 

Possible Errors

However, full automation is difficult to count on, because of periodic inexplicable errors.

.