Tuesday, May 20, 2008

AutoCleanupDays in Workflow

Hi All,

the problem with the workflow history is that you will lost your histor details after 60 days. 60 days is the period when you will lose your workflow history. its a built in mechanism of 60 days.

There can be multiple way of getting rid of this problem.

I would like to share two ways of doing it.

First is through code, Here is a way:

Assuming that objWorkflowAssociation is an object of type SPWorkflowAssociation, then

SPWorkflowAssociation objWorkflowAssociation;
objWorkflowAssociation.AutoCleanupDays = 9999;

Will set the cleanupdays to 9999 days. so you are now in relief to have your history till 9999 days instead of 60 days.

Second way :

Note the addition of an node in the following sample Element Manifest Xml:

<Elements ...>
<Workflow ...>
<metaData ...>

but Make sure that this might now work with built in workflows, but sure for your own created workflows.

That's it. That's two way we can accomplish this task.

No comments:

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com