Friday, September 30, 2011

Trigger event when workflow is added to a document library

Requirement:  I've created a custom sequential workflow using Visual studio and wanted to create SharePoint group when the workflow is added to a document library.

Issue: There is no event or activity associated to the Workflow which will be triggered when we add a Workflow to a document library of list. Also there is no event associated with document library or list that to be triggered when a workflow is added to it.

Solution: Create an association and initiation form in a workflow using VS.NET 2008. You can use either .aspx or InfoPath forms in a workflow. Association and initiation forms are displayed for users to complete before any workflow actually starts.Association forms are displayed to administrators when they first decide to add or associate a workflow with a particular list, document library, or content type. You can use association forms to let an administrator specify parameters, default values, and other information for the workflow as it applies to items on the list, library, or content type with which the administrator is associating it.

Below are some excellent resource I referred to and implemented successfully. Please refer to
http://msdn.microsoft.com/en-us/library/cc297199(v=office.12).aspx

Workflows for WSS3 Demystifying ASPX forms association

http://sergeluca.wordpress.com/2008/11/20/step-by-step-tutorial-creating-workflows-with-windows-sharepoint-services-and-moss-2007-part-1420-easy-aspx-association-forms-my-small-generic-framework/


No comments:

Post a Comment