Bulk Record Deletion in Microsoft CRM Online

This blog post will cover custom filter-based mass record deletion for a given entity System.

In this article, I will walk you through some scenario-based examples that I hope will provide some clarity for your CRM implementation. Because there are so many ways to use CRM, I’ve tried to cover the most common scenarios.

Scenario 1 – Undo Imports

I ran data import for some entity but then realized that the data is now obsolete and not relevant anymore and wish if I can undo this import.

For Example: Campaign responses I imported are no longer relevant as campaign is not being pursued anymore due to some reasons.

  • You have imported the campaign response successfully into CRM
  • Now you intend to undo this import for some reasons. For this simply do the following:

a. Launch MSCRM and on the left navigation, click Imports.

clip_image002

b. In the right side, select the import (in this example, “Recall Campaign Responses”)

clip_image004

c. In the grid toolbar, click on “More Actions”

clip_image006

d. Under “More Actions” menu, Select “Delete Imported Records” option

clip_image008

e. The dialog box appears with these options:

i. Name for Bulk Delete job against this Import.

ii. You can configure it to send email Notification to your outlook on your CRM email id. Additionally, you can chose to notify others on completion of this Bulk deletion for the imported records.

iii. Optionally, you can also choose to delete the Import job entry for given Import targeted for bulk deletion. This is the import job entry you see in import job grid view (see above figure). It is recommended not to use this option if user wants to keep the import job entry as it also serves as reference to know when, what all imports were run. As such deletion of this entry has no other significance or side affect.

clip_image010

Scenario 2 – Deletion of stale data (not relevant to business anymore)

Example 1

  • I have a small business and am considering many CRM solutions and MS CRM is one of those.
  • I buy trial version of Microsoft Dynamics CRM Live and start using it for evaluation.
  • I am satisfied with Microsoft Dynamics CRM Live, so now I plan to clean the system from all the test data.

Example 2: I find that there is need to delete the leads converted to opportunities. But how do I do it; it runs across multiple pages even if I increase page size to 250 records)?

If there is some way to do so, it will really make my life easy.

Yes, it is possible to do so in CRM live. Simply follow these steps:

1. Launch MSCRM and on the left navigation, click Sales.

clip_image012

2. Under workplace, click on Lead entity.

3. In the right navigation, select the view “Closed Leads”

clip_image014

4. Under grid toolbar select the menu bar “More Actions”

5. From “More Actions”, select the option “Bulk Delete”

clip_image016

6. This will launch “Bulk Delete Wizard”. Complete the wizard using the following instructions:

clip_image018

a. Define the Search Criteria using Advanced find query view

(This will open with the query for selected view)

b. Once you have defined the query to target records for deletion, click Next.

c. The next screen in the wizard provides you the following options:

i. Name – name of the bulk delete job. A default name will be auto populated but you can change it to make more meaningful e.g. closed leads deletion job.

ii. Bulk deletion job start time – the date and time populated is the according to the time zone user is in. e.g. if user is in IST time zone then user will date/time as see GMT +5:30 hours.

iii. Next is checkbox – Run this job after every – this corresponds to recurrence setting.

On selecting this checkbox, the dropdown below will become active. This dropdown will show the default recurrence option (in terms of days). If your choice is not there in the dropdown then you can manually enter a value (it should be a value between 1 and 365)

iv. You can choose to send email to you and optionally others as well.

clip_image020

d. Here, clicking next will take you to the Summary screen where you can review the options selected. This gives you chance to ensure that everything is as you desired, if not, go back make the appropriate changes and come back.

e. If you chose to Submit here, it will create a bulk delete job in CRM. Since this job is of asynchronous nature it may take some time for the job to start the record deletion. It further depends on the size of targeted record set on how much time it takes to complete the job.

clip_image022

Scenario 3 – Can I schedule the deletion for recurrence?

Well, I had good first time experience using bulk deletion wizard. But how can I use it to delete on periodic basis?

For Example: How do I use Bulk deletion wizard to delete my converted leads for last 30 days?

Step 6c in above scenario will answer your question. Having said that, if you have incorrectly set the recurrence in the first shot you can change it now (provided there is some recurrence pending according to old recurrence)

Do the following:

  • Go to settings-> system jobs
  • Select “Recurring system jobs” view
  • Select Bulk delete as type
  • Select your bulk delete job
  • From grid toolbar select “more options” and then select modify recurrence option
  • This will take you to dialog with recurrence options.

clip_image024

Scenario 4 – running out of quota, need to free up some space

I am running out of live space quota, need to free up some space. Your options are:

  • Figure out which entity records are eating up majority of space and run bulk deletion for the same.
  • Freeing up live quota space by deleting past instances of bulk delete system job. This is specifically interesting when you have lot of bulk delete failed jobs and those are having huge number of failure records thus consuming the quota significantly.

Narrow down the view in ‘Systems jobs’ screen by selecting Type=’Bulk Delete’ and View=’Completed System Jobs’ [screenshot below].

Now select the specific system jobs and delete. This will also clear the records created to captures failure information corresponding to the selected jobs and release space.

clip_image026

  • So, when does one get the error message: “Selected system job could not be deleted? Only completed jobs can be deleted”?

Possible reason is that you have selected the “Recurring System Jobs” view and tried to delete the job that has recurrence still pending.

To delete a recurring job that has recurrences yet pending, the job has to be cancelled first:

  • select the job: Settings -> Data Management -> select ‘recurring bulk deletion system job’ view -> select the job to cancel
  • cancel the job: Select ‘Cancel’ from ‘More Options’

Now you should be able to delete this recurring System job from settings ->System Jobs. However, while this ensures that the job will occur in future, to release the space utilized for storing failure information of the previous instances of this job, you need to delete those instances as explained in sl. 1 above.

Now that you know the power this functionality provides, you can build your own scenarios.

Frequently Asked Questions (FAQ):

  • I have a bulk deletion job scheduled to delete “converted leads every 30 days”. But now I feel the number of such recodes are growing much faster and making me run out of my live space quota. Can I change my schedule to delete such records every 7 days?

Scenario 3 answers your query.

  • I wish wizard could make out the deletion query automatically for my existing view say “My Inactive Accounts”?

Scenario 2 will answer your query

  • Who will be the default email receiver?

It will be the user who creates the bulk deletion job.

  • Will I get email if I happen to delete the out of box email templates?

No, in that case you won’t get any email. Hence it is advised that instead of deleting these email templates customize the same to suit your needs. The name of the templates is as follows:

clip_image028

  • Can I specify my own email-template?

No. Please customize system templates as per your own need. Do not delete those.

  • Where do I see the Bulk deletion job status and how do I identify my job among the crowd?

Firstly, the summary screen, that appears just before the delete job is submitted, specifies how user can view the status of the job submitted. Secondly, on completion of the job, user will get email notifying if the job has completed with failures or success. The email body also clearly specifies how to navigate to the particular screen where user can view the job status.

  • Does bulk deletion wizard honors client time zone settings?

Yes, the date and time shown in the wizard is as per client time zone.

  • Why doesn’t my job link open in the email?

This is currently a limitation where the hyperlink works fine for on premise deployments. This will be fixed in next version.

In single organization environment, you might give a try to replacing ‘@servername’ with fully qualified name in the following email templates:

  1. Bulk Deletion Task Completed With Failure Template
  2. Bulk Deletion Task Completion Template
  3. Bulk Deletion Task Failed Template

I should warn you that in multi organization environment there might not be a workaround which works for all.

  • Can I pause / resume a bulk deletion job?

A bulk delete job with more than few 1000 records to delete can be effectively paused, for smaller size by the time user pauses the job would have already executed (batch size is one thousand records).

  • Why does it sometimes take a long time to bulk delete records?

If the records you are deleting have child records, and cascading delete exists (such as Contacts that have a Parent Customer set to an account), it takes longer for the bulk delete to complete.

  • Why does a job fail?

A bulk delete job fails for perfectly valid business reasons and not for any technical limitation of the feature. As an example, if user tries to delete a territory without first deleting all the accounts associated with that territory, the delete action will fail. These are in-built deletion constraints in CRM; Bulk Delete feature is not introducing anything new here, but just utilizing the existing deletion framework.

  • Can a lay user understand the instructions and reach at the job status view?

The texts are UE scrubbed and we are confident that the instructions are easy enough to understand.

  • What will user do after viewing the job status?

From the job status view, user will come to know why a record could not be deleted. He will then take corrective functional actions before submitting the delete job again (For example, now perhaps he will first submit a job to delete all accounts then the job to delete territory).

  • What else may the user do now?

Failure details are required to be stored displayed so that user can address the problem. However, like any other record in CRM, failure details will also consume space. Hence after viewing the detail for the failed job, user may like to delete the record by simply clicking the delete icon on the top of the grid. Here user can also multi-select records and delete. This is exactly similar to how user can delete a record from any other grid view like account, opportunity, leads etc.

  • Under what circumstances may the failed deletion job records contribute substantially to space consumption?

If a recurring bulk delete job (for such jobs, user sets a frequency in which the job will re-run automatically) fails and user does not address the cause (viz. ensure that accounts are deleted before territory…etc.) then in subsequent recurrences also the job will fail adding new records to the failure table. If this continues to happen for a number of recurrences the failure records will continue to accumulate.

Resolution for space release: The past occurrences of the Bulk delete job can be deleted releasing space. Also, the recurring job itself can be canceled and deleted preventing any future occurrence.