Home > SharePoint > SP2010: Associating a Visual Studio workflow with a content type

SP2010: Associating a Visual Studio workflow with a content type

In SharePoint 2007, when you created a workflow in Visual Studio, it allowed you to associate it with a list or a content type by default.  In Visual Studio 2010 however, it only allows List association by default.

To allow your workflow to be associated with a content type, you need to modify the elements.xml and specify both list and content type as follows:

image

See http://msdn.microsoft.com/en-us/library/aa543430.aspx for more details.

Advertisements
Categories: SharePoint Tags:
  1. March 19, 2010 at 10:23 am

    This was exactly the problem I was having with my workflow deployment. It was not showing up in the content type workflow settings! I followed your advice and added the AssociationCategories property with the #ContentType value to my workflow’s elements.xml. Like crazy voodoo magic, my custom workflow appeared in the content type’s workflow list. Thanks so much for this post, Sir!!

    By the way, you can also set the workflow to a specific content type (or list if you wish) by specifying the ID (GUID) of that item. (http://msdn.microsoft.com/en-us/library/aa543430.aspx)
    Rock On.
    ~Jake~

  2. May 16, 2011 at 5:42 am

    You need to change automatically generated code by Visual Studio for initiation form if you want your custom workflow to work with contenttype.
    http://www.inno-w.com/d/content/fix-initiation-form-generated-visual-studio-2010-workflows-associated-content-types

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: