SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have workflow which enables creator of list item to edit it later. Is it possible to associate workflow with certain list templates, so when user creates new instance of such list, workflow is there and does it job?

share|improve this question

In SharePoint 2010 you can use SPListEventReceiver. This class contains handler to perform actions on ListAdded event. In this event you can retrieve list template from current list and compare it with needed template, if the tamplates are equal you can assigne the workflow to this list by code.

SPWorkflowAssociation workflowAssociation = SPWorkflowAssociation.CreateListAssociation(workflowTemplate, associationName, taskList, historyList);
workflowAssociation.AllowManual = true;
workflowAssociation.AutoStartChange = false;
workflowAssociation.AutoStartCreate = false;
workflowAssociation.AssociationData = associationData;
workflowAssociation.Enabled = true;
share|improve this answer

you can use this tool to associated event handlers with a list.

Good luck.

share|improve this answer

Your Answer


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.