Showing posts with label List. Show all posts
Showing posts with label List. Show all posts

Wednesday, April 11, 2007

Capturing onItemChanged event in Workflow

To catch the onItemChanged event of any Sharepoint list in a workflow, the following needs to be done:

  • Add a CallExternalMethod Activity, set the interface to Microsoft.SharePoint.Workflow.IListItemService
  • Set the method name to InitializeForEvents
  • Bind the ItemId, ListId to ItemID and ListId in the workflow properties.
  • Add a HandleExternalEvent activity and specify the following properties:
    InterfaceType to Microsoft.SharePoint.Workflow.IListItemService
    Event Name : OnItemChanged
    NOTE: The correlationToken should be the same as the correlation token specified for CallExternalMethod activity.
    Method Name. This method will be called whenever there is a change in the list item.
  • This will capture the onItemChanged event.