Follow in Twitter & Facebook


Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools


Tuesday, September 20, 2011

How to attach a workflow to a content type?









A SharePoint workflow can be attach to a list, site or to a content type in SharePoint 2010. But there are only two options in the workflow wizard: list or site workflow. So how do you associate workflow with a content type? In order to associate workflow with a content type you have to change the AssociationCategories element value in the workflow’s Elements.xml file to ContentType.

For this Double click the Elements.xml file for the workflow to open it.
Locate the AssociationCategories element and change its value to ContentType  like:
<AssociationCategories>ContentType</AssociationCategories>

Click on the Workflow1 project item folder and open the Properties window. And change the value of the Auto Associate property from True to False.

Then press F5 to build, package and deploy the project.
Then go to the Site Actions ->Site Settings and under document content types click the Document content type.

Now click the workflow settings link, the Workflow settings page is displayed. Click the Add a workflow link, the add a workflow page will be displayed and from there you can select the workflow for the content type.




0 on: "How to attach a workflow to a content type?"