Code Project

Link Unit

Showing posts with label Workflow. Show all posts
Showing posts with label Workflow. Show all posts

Tuesday, July 27, 2010

Multi-Value Columns in SharePoint Designer Workflow

Requirement :

Create a workflow so that any new item created in the list should fire the mail to recipients.

#1 Create a Multi value column in a list

#2 Now on creation of new item attach the workflow to send the mail.

The multi value column is missing in workflow .The SPD suffers from a deficiency in the workflow component ,which doesn't allow you to send e-mail to multiple recipients from a multi-value column of a list using SharePoint Designer 2007 (SPD).

Solution #1

Turn off "Allow multiple selections" for your column (note the warning "This will remove all person values except the first one") . Now you should be able to provide the column as lookup column in workflow.

Change the workflow and then turn "Allow multiple selections" on for your column.

This solution is not acceptable as it removes all the values except first value. So the approach is good till development but once workflow goes to production you won't be able to touch the workflow or list where you would like to turn off "Allow multiple selections"

Solution #2

Create a variable var _employees in workflow

Set the value of variable "_employees" to your "multi value column".

Send the email using the variable "_employees"

The second solution is simple and elegant.


I hope it helps.

Tuesday, June 08, 2010

Workflow stuck at Starting

Workflow stuck with "Starting" status is probably the most difficult to debug because there are generally no diagnostic entries in the ULS logs or event logs to point you to a problem.
The problem we faced at our work place is that all setting are as per this blog post http://www.tonytestasworld.com/post/Sharepoint-2007-Workflow-stuck-in-quot3bStartingquot3b-state-and-never-completes-when-set-to-start-programmatically.aspx .
i.e
1 Environment is properly configured with the SSP and everything set up correctly as mentioned in the blog.
2. Windows Sharepoint Timer service is up and running.
3. Domain account was used for configuring SSP.
Even after doing all the stuff workflows were getting stuck with a "Starting" status.
We have a custom workflow attached to a Document library and it is supposed to trigger when a new item is added or changed. The library has the 'require check out before editing' setting enabled so even a manual document upload to the library would first check the document in and then you'll be presented with the screen for providing any required metadata and once you are through that THEN the workflow would trigger (workflow requires a document to be checked-in before it can start).
So disabling the 'require check out before editing' solved the issue for us.