Applications Services Blog
Get the latest thought leadership and information about the role of Applications Services in an increasingly interconnected world at the HP Blog Hub.

Microsoft Dynamics CRM 2013 Bulk import and delete of Subject data – Part II

In the first part of this two- part series, I talked about bulk importing Subject data into Dynamics CRM 2013. In Part II, we are going to discuss the challenges in deleting the Subject data that was imported and possible options to achieve the bulk delete.


Subject Bulk Delete


So after I imported about 300 odd Subjects as described in Part I of the series, it was time to go on my merry way, right? Well, not so fast. There were slight modifications to about 10% of the values, which was a decent number when you look at the total Subjects imported.


It did not help that Subject values are not available in the Advanced find, and there is also no way to export the data and make the changes and re-import the data file.


So my next thought was to just delete the imported Subjects, make the changes to the source csv file and redo the import. Typically, if you go to the data import list, you will be allowed to select the rows that were processed, and delete the records from the CRM system. Unfortunately, Subject imports are unique in the sense that the delete button is not available, which means that I cannot bulk delete the imported Subjects.


Before we give up hope, notice that the Run Workflow button is available/ enabled! So if we write a custom workflow (as delete is not possible from the OOB workflow), we could run that workflow to delete the imported Subjects.

If you like to see the custom code, here is an example of how to delete a record by Dave Berry. Another excellent resource is the CRM 2011 Workflow Utilities project on codeplex written by Gonzalo Ruiz.


Note that even though the solution is for version 2011, I had no issues while I imported it into a CRM 2013 system.





Next, create a workflow to delete the subjects using the custom step CRM2011WorkflowUtilities/ Delete.





Once the workflow has been created and activated, select the list of imported Subjects, click on run workflow and pick the workflow  created. The result is that the imported Subjects are deleted from the system, which then lets me redo the import with the correct values.






Note: If you are using Subjects in your workflows, when you move your solution from one org to another, the workflow will deactivate due to missing/ invalid references. If you want to avoid that, you will need to import the Subjects with their guids  as the Subject value.


Since you cannot export the Subject list, the only way to get the Subject guids is from the organization database SQL query, unless of course you are willing to write custom code to extract all the id's through webservices.


Thanks for reading, and please leave your feedback in the comments section!

shekar | ‎09-11-2014 04:12 AM

Other option is to use to go to the same imported csv, select it, select Delete and select Delete all imported data

Showing results for 
Search instead for 
Do you mean 
About the Author
CRM enthusiast, avid techie

Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.