Deleted Records hanging in there! Forcing the delete job

by Bill Owens 22. July 2010 23:46

Here is a scenario for you to ponder..

  1. You have a separate database with accounts in them that need to be uploaded to MSCRM.
  2. You use the DDM or write your own application to load the data into MSCRM
    • You use the key (a GUID) from the data being imported as the new key in CRM. Yes you can pass in the key GUID you want to create the record for.
  3. You realize you need to make some changes.
  4. You delete the records in MSCRM using the screens
  5. You try the import and it fails telling you you have a duplicate key.
  6. You search the screens thinking you did not delete them only to find out you did.

What happens when you delete a record in MSCRM is that the record is flagged with a 2 in the deletion State Code and a daily job runs that will clean up and perform all of the deletions.

So no the question, how do you force the deletion job to run NOW.

Well it is not hard.

Run the following SQL on your SQL Server

 

USE MSCRM_CONFIG 
 
UPDATE ScaleGroupOrganizationMaintenanceJobs 
SET NextRunTime = getdate()
WHERE OperationType = 14 

then restart the Microsoft CRM Asynchronous Service

 

 

I would suggest that after you are done you revisit this and set the next date/time to sometime in the evening well before backups so that the job runs normally after hours.

Tags:

CRM 4.0

Page List

About the author

I work for a consulting firm in Dublin Ohio called Affiliated Resource Group. For the last five years I have been spearheading our Microsoft Dynamics CRM practice. I have a deep appreciation for the Microsoft CRM platform and I am very excited about it. You might even describe me as a Microsoft CRM Advocate. I have many battle scars from my experience with the product and I’m constantly being asked questions about CRM and how-to-do something in it. Hence, this BLOG is to help disseminate that knowledge and information to everyone. As of last year I was posting links to many other blogs to help spread the knowledge, but now with the community.dynamics.com doing that for me, I will be following that practice unless a really juicy article catches my eye. Many people have asked where my post are for the first half of 2010, my company had me posting to another blog and maintain two was near impossible. I am now down to just this blog. So good luck and I hope that this blog may help in some way. If you have suggestions or questions, please email me them.

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 BillOnCRM