Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Using Visual Studio I have created a package for SharePoint 2010 that deploys a Workflow that creates Tasks of a custom Content Type Id. When I first deployed it, I noticed that Tasks were being created but they were of the type Workflow Task instead of my custom Task. I fixed it by manually updating the Task list to include my new Content Type.

As part of the deployment (for development purposes), the Workflow is automatically associated with an existing Document Library. In addition, the Workflow is configured to use the existing Task List.

My question is this -- How can I automatically add my custom Content Type to whatever Task list the workflow is configured to use when it gets associated with a given list? What about removing the Content Type when the workflow is disassociated?

I noticed that because I have a workflow association form, there is code that checks if the task list and history list exist, and creates them if necessary. Should I just add code there? Is this something that falls under event receivers? (Not sure what the association form since it does not get called when the workflow is being removed...)

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Unfortunately there does not seem to be a way. There is no event to hook into when a workflow is associated/disassociated with a list. My solution at this point, for making development easier, was to write a PowerShell script that will create the association and add the content types and then another script that undid that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.