Today I have a bit of a Kerberos double hop of a blog post and anyone who laughed at that joke really is a CRM geek.
On one my favourite CRM blogs Jamie Miley he had a blog post called
well he then linked to a very interesting post by Gonzalo Ruiz
By this point you are wondering what the hell the blog post is actually about but I thought the information in the two blog posts is so important it should told to as many people as possible. Also well done to Gonzalo Ruiz for writing a great blog post and having an interesting blog. Anyone who used CRM 4 will know the AsyncOperationBase database table would slowly get clogged up because it kept data about any system jobs/workflows/plugins as well as individual workflows/plugins and async jobs.
When we reported speed issues to Microsoft they gave up some scripts to run which would clean this table up. I believe that when you upgrade you database from CRM 4 to CRM 2011 the scripts clean up this table for you (although I would recommend doing it yourself before you upgrade to save time)
In CRM 2011 there are a couple of areas where you can state you don’t want workflows that succeeded to be entered into the table. If you click the workflow and then go into administration tab. Interesting dialogs do not have the option to delete when complete.
I was wondering if this is always a good choice to stop logging successful workflows. You probably only want to see the workflow records of failed workflows but when you are developing a workflow it’s useful to click on a workflow result record and check the entities is created/updated to make sure it has done it correctly. For workflows which are well tested and don’t fail very often then it’s probably a good idea and the benefits of decluttering the AsyncOperationBase are certainly worth it.
The same option is now available for asynchronous plugin steps as well:
This allows you to pick and choose which workflows and plugins are worth storing as system jobs every time they execute and which ones you want to delete upon completion to save space!
However, in order for the async auto-delete feature to take effect, you must first make sure that the “auto-delete” feature is enabled for the organization. There is a master switch that must be turned on:
select BitColumn from OrganizationProperties where ColumnName = ‘AsyncRemoveCompletedJobs’
Note that you can have a different value in that setting for each organization. In CRM Online, this value is always 1 (enabled) for all organizations.