Tuesday, November 2, 2010

SharePoint 2010 Work Flow (WF) Quick Hits

SharePoint Work flows are pretty strait forward for the most part but there are a couple items that are worth remembering. Some of them I have had to learn twice so this list I’ve made to review before I do WF implementations, in an effort to not have to learn things a third time :)

These notes are specific to Work Flows in SharePoint Designer.

1. Always save then publish.

2. If you have a test page open after the WF has been updated reload the page before initiating the WF. SharePoint will force you to do this anyway but you can lose any changes you made to test the WF.

3. When sending an e-mail via WF using a look-up person value select e-mail address, semicolon delimited for the look-up value.

4. In general, if you are using a look-up values in the WF verify it is not empty (Null) before using. If the error, Coercion Failed: Input cannot be null for this coercion, it is because a field has a null value or is empty. The Fix is to use the conditional IF-Else construct to check for Null before executing the actions, example: IF field is not empty.

5. A record seems to only be updateable by a WF once.

6. Conditional statements like IF-Else don’t move up and down so well in the WF step.

7. To create a state machine using a WF
a. Create a list or column to contain a copy of the field(s)
b. Seed the field with a copy of the content
c. Create a WF that accounts for the following conditions
d. Initial creation of the list item
i. Might be necessary to seed the list or column
e. On value change account for the following conditions
i. Different Content -> Previous Content is different
ii. Different Content -> Previous Content was Blank
iii. Current Content is Blank - > Previous Content was not
iv. Blank -> Blank
1. No action should be required as the state did not change
f. For an example / more information on how to do this see this link: http://office.microsoft.com/en-us/sharepoint-designer-help/watch-this-run-a-workflow-when-a-specific-field-changes-HA010256419.aspx

8. Hyperlinks made in the WF e-mail editor can be copied and pasted but the pasted version may need the link to be adjusted. Look-ups used in the e-mail editor cannot be copied and pasted.