5

I need to perform some tasks (in this case, add/remove content types) when a workflow is associated/disassociated with a given list. Is there an event that I can listen for/hook into? I am using Visual Studio to develop and deploy my solution.

1
  • As Robert mentions, there is no event to hook in to. My hack solution was to write two PS scripts -- one to create the association and add the content types and another to undo that.
    – Jason
    Mar 4, 2014 at 13:17

1 Answer 1

0

At least for 2010, the answer is no. Here is a list if all events you can create event receivers for in 2010:

http://msdn.microsoft.com/en-us/library/office/ff408183(v=office.14).aspx

Same seems to be valid for 2013, despite the fact that the number of possible events has increased. You have for example WorkflowStarted and similar, but not WorkflowAssociated or something like that.

Full list here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceivertype(v=office.15).aspx

4
  • What is the ContextEvent all about?
    – iOnline247
    Mar 2, 2014 at 14:24
  • 1
    @ionline247, not sure but my guess it is is used internally for triggering workflows on for example ItemAdding (-ed) or ItemUpdating(-ed). This documentation about it being reserved for internal use leads me to believing so: msdn.microsoft.com/en-us/library/… Mar 2, 2014 at 14:34
  • Cool. Thx for the link and insights.
    – iOnline247
    Mar 2, 2014 at 19:47
  • Looking over the documentation I came to the same conclusion. I find it hard to believe that nobody else has needed this type of functionality... I would think it is typical that some sort of prep work is needed when a workflow is associated with a list. Does everyone just manually add the content types each time? What has everyone else done in this type of case? Any suggested workarounds?
    – Jason
    Mar 3, 2014 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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