The Microsoft Dynamics CRM Blog
News and views from the Microsoft Dynamics CRM Team

Bulk Record Deletion in Microsoft CRM Online

Bulk Record Deletion in Microsoft CRM Online

  • Comments 16

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.

Note: If you are looking for Migration Deletion support in Data Migration Manager, then please read following blog post instead: http://blogs.msdn.com/crm/archive/2008/03/13/migration-deletion-support-in-data-migration-manager.aspx.

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.

Here I am assuming that you know about how to do data import in MS CRM. Otherwise, you can read more from this blog post

http://blogs.msdn.com/crm/archive/2008/03/07/importing-data-in-crm-4-0-made-easier.aspx

  • 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.

Related blog Post(s)

You can also save on your live space by deleting any duplicates. For more details read this blog post:

http://blogs.msdn.com/crm/archive/2008/01/17/crm-4-system-wide-duplicate-detection.aspx

Cheers,

Sharad Sharma

  • PingBack from http://microsoftnews.askpcdoc.com/data-management/bulk-record-deletion-in-microsoft-crm-online

  • How come scenario 2 and 3 not is not available in other CRM 4 editions?

  • Hi, how do you add the "bulk delete records" option there, in Scenario 1 picture d. I only have share option in my crm

  • Hi,

    I haven't found "Delete Imported Records" option under the "More Actions" Button in the Imports from the Left Navigation Bar!

    Any reason for this, kindly let me know. Its making me curious.

    Thank you

    Regards

  • Hi, how did you get the option "bulk delete records" in scenario 1 picture d?

    I only have "share..." there.

    Thanks

  • I have seen couple of comments here about the availability of this feature.

    This features was developed as part of "CRM Online" which went online on April 14, 2008

    Note: If you have EA1, EA2 online release then this feature won't be available.

    in online context this feature make more sense as there is given quota of space and people have a natural need to manage this space to run business smoothly.

    If there are more queries, let me know.

  • Hi, Sharad.

    We are using CRM server not online. I'm wondering is there a any to add this function into our CRM server. There is a sample code in CRM SDK 4.04 package called "bulkdeleteoperation.cs". Is this code for this function?

  • Why is bulk deletion services not available for the on premise CRM and or can it be added easily?

  • the UI was released specifically for Live and am not sure when it will become available in on premise. But yes, using platform on can write a custom bulk deletion feature.

    sample code in CRM SDK 4.04 package called "bulkdeleteoperation.cs" is meant for the same purpose.

    also read - Bulk Delete Operation Entity Capabilities  and related entries in the SDK

  • I installed the 90 trial of CRM 4.0. I do not have the "Delete Imported Records" option. Is that for Online Version Only?

  • I ave a business requirement where i need to retrieve and show in the custom page only the latest record entered for an entity say account.how can i acheieve this using SDK

  • Those Zune guys make it look so easy: Zune 4 = up to 1,000 songs, while Zune 120 = up to 375 hours of

  • Those Zune guys make it look so easy: Zune 4 = up to 1,000 songs, while Zune 120 = up to 375 hours of

  • Those Zune guys make it look so easy: Zune 4 = up to 1,000 songs, while Zune 120 = up to 375 hours of

  • I would like to use the Bulk delete option but it is not presented when following the steps in Scenario 2 – Deletion of stale data (not relevant to business anymore)

    I have System Admin role and System Customizer role whatelse do I need to use Bulk Delete?

    Thanks,

Page 1 of 2 (16 items) 12
Leave a Comment
  • Please add 8 and 8 and type the answer here:
  • Post