Sharepoint 2007 Custom Workflow Initiation form Gotcha

I recently came across a nasty bug in Sharepoint 2007. When a custom workflow uses an intiation form to collect data for the start of a workflow, it will only collect this form when the workflow is run manually.

Workflow intiation forms can be created using InfoPath or aspx pages to collect data that can be used in the workflowProperties.InitiationData property. This form is only presented to the user when the workflow is run manualy in Sharepoint 2007. If you set the workflow to start automatically when an item is created or changed, Sharepoint will not present this form to collect the InitiationData.

There are a couple of work arounds you can use to get around this bug. One is you can set the InitiationData using an Association form when the workflow is first added to the Sharepoint list. You can also just make sure not to select the 'Start this workflow when a new item is created' or the 'Start this workflow when a new item is changed' check boxes.

Comments
Chris's Gravatar I don't think this is a bug. Isn't it normal that automatically started workflows don't show an Initiatian Form?!?!

How should they do this, i.e. a file is being uploaded via an external program?
# Posted By Chris | 2/8/08 8:36 AM
David Fekke's Gravatar It may not be a bug, but it is definitely something you have to take into account whe n you are designing Sharepoint workflows. If you require information to be filled out at the beginning of a workflow, you will either need to collect that through metadata on the item that is initiating the workflow, or through a custom task.
# Posted By David Fekke | 2/8/08 9:14 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.6.001.