Thursday, February 4, 2010

SharePoint Workflow Errors: Descriptions, resolutions and Workarounds

The following table lists some of the common errors that can occur in a Workflow developed using SharePoint Designer. A short description of some of the likely causes for each error are also provided.

More detailed examples of the following scenarios where an error may occur in a SharePoint Designer workflow are also provided later in this post:
  • Exiting / Breaking a Looping Workflow using Workflow Errors
  • Workflow Permissions
  • Changing the name of a Document in a Document Library
If you come across a workflow error which is not explained below, please post details in a comment to this post. I will ammend the table and information below to include any additional errors, descriptions and possible causes to build a comprehensive list of workflow errors and resolutions when developing using SharePoint Designer.

Workflow Error Summary Table

Status / Event Type Description Outcome Possible Cause(s)
Error Error updating a list item List Item Not Found No item in the list matching the critera used to find a list item being updated.
Error Error updating a list item Access Denied Permissions of the user who initiated the workflow don't allow them to modify data in the list item.

- Stopped

Event Type: Error

Error Deleting a list item Access Denied Permissions of the user who initiated the workflow don't allow the user to delete items from the list.
Error Error updating a list item Unknown Error

Attempting to update Approval Status of a list item from a Workflow initiated by a user without approve permissions on the list/library.

- Failed on Start (retrying)

- Stopped

(Event Type: Error)

Error updating a list item Unknown Error

Incorrect data types.

Eg. attempting to include illegal characters in the filename of a document by appending the date to the filename.

Permissions:

Attempting to update a list item using the permissions of the user who initiated the workflow, who doesn't have access to update items in the list.

Error An error has occured in ...Workflow Name
A previous workflow error has caused the workflow to halt.
Error Error updating a list item Document must be checked out

The document or list item being updated is in a list or library with force checkout enabled.

First check out the document before making changes from a workflow, or disable force checkout.

Note: Setting the Approval Status via a Workflow created using SharePoint Designer is not possible when Force Checkout is enabled.


Below are a series of scenarios where Workflows developed using SharePoint Designer will halt or stop due to a Workflow Error. An explanation of the cause of the error, as well as a resolution or workaround for the issue are also provided for each scenario. There are also instances where a workflow error can be caused intentionally to break a looping or repeating set of workflows once the looping sequence has completed (eg. processing all list items - see below).

Error Scenarios

Exiting / Breaking a Looping Workflow using Workflow Errors:
Looping Workflows developed using SharePoint Designer are often configured to stop due to a list item not being found. For example, when processing all items in a list using looping workflows, each instance may be initiated by updating a field from each item in the list being processed to initiate a separate iteration of the loop for each item. When all items have been processed, the workflow will not be able to find the next list item adn as a result will halt with an error ("Error updating a list item" : "List Item Not Found"). In cases similar to this, the workflow may not have stopped, as the workflow will sometimes retry the operation which caused an error depending on the type and severity of the error. Also, some errors will prevent new instances of the workflow initiating on the same list item with a workflow error. In scenarios where the workflow process should loop, this can be a problem as the workflow may not be able to move past the first iteration, or will cause the loop to stop if a workflow halts midway through the looping process.

Resolution / Workaround:
To ensure that a workflow loop continues until it has completed all required iterations, configuring the workflow initiate when an item is added to the list will result in each workflow initiated for each iteration of the loop being associated with a different list item. If one of the workflows halts due to an error (intentionally or unintentioanlly), the remaining iterations and components of the workflow can still continue as they will always be initiated on new list items added to the list. To help keep lists tidy, it may be a good idea to include an action late in the workflow to remove the current (temporary) list item once it has completed operations required for the current iteration and initiated the next iteration of the loop. After all items in the separate list have been processed. The workflow for the final list item created will stop due to a "List Item Not Found" error. As there will be not remaining items in the list which match the criteria required to find and initiate the next iteration, the loop will stop, breaking out of the looping sequence.


Workflow Permissions:
It is very common for developers of workflows in SharePoint to have elevated permissions on the SharePoint Site Collection in comparison to the general end-users of the SharePoint environment. This can lead to workflows not functioning as expected, or not working at all once in use, as testing may have been completed using the permissions of the workflow developer. To help prevent access / permission issues with workflows in SharePoint, you should always thoroughly test workflows using accounts with identical permissions to end-users of the SharePoint environment and workflow. In some cases this may require you to test using multiple accounts with varying permissions matching that of the end-users, or to change the permission level of one or two test accounts in order to test all possible scenarios.
As a workflow runs using the permissions of the user who initiated / triggered the workflow, in many cases during development it will be running using the credentials / permissions of the developer. If the developer has elevated access to components on the SharePoint site including lists associated with the workflow, the workflow will often function as expected during development, but not work once deployed into a production environment.

Resolution / Workaround:
When a workflow is initiated by a user with standard permissions, and the workflow needs to complete actions that would require the user to have a greater permission level on the site and lists, you can split the worklfow into components which are then initiated by users with the required permissions.

For example, a general user may make a change to a document stored in a document library with content approval enabled. A custom approval workflow is initiated to create and assign tasks to have the changes approved. As the Approval Task is created by the workflow running as the user who submitted the changes for approval, the user requires permissions that allow them to add items to the Approval Task list.

If using the "Collect data from user" action to get the approval status of the changes from an Approver, the workflow will continue to run as the user who initiated the worklfow (not the approver) once the approval status has been collected. This will result in a Workflow error if you try to update the approval status of the list item or document, as the user who made and submitted the changes for approval doesn't have approve permissions on the list/library. A solution for this problem is to split the workflow into two separate workflows. One to initiate the approval process and create the approval task item, and a second workflow on the Workflow task list which will be initiated by the approver when the approval status for the changes is set. You will not be able to use the "collect data from user" action, as this will result in the workflow continuing using the credentials of the user who initiated the workflow and a workflow error when attempting to set the Approval Status. Instead, you should create a new content type with only the fields required to collect the Approval Status for a modified list item and use the "Create List Item" action to create the Approval Task. Once created, associate the content type with a task or other list type, making it the default and only content type available on the "New" menu for the list. In the workflow associated with the content approval enabled list, you should use the "Create List Item" action to add an Approval Task item to the task list, then complete the workflow (Stop).

The Second workflow associated with the task list should be configured to initiate when an item in the Approval Task list is modified. The first step in the workflow should be to check to see if the Content approval status has been set by the approver. If not, then the workflow can stop as it will be reinitiated when the approval status is updated by an approver. If the approval Status has been set, then the workflow can continue to update the Approval Status of the list item or document that was changed and submitted for approval. The approval status can now be set by the workflow as it will be running using the permissions of the approver, not the user who initiated the approval process.


Column Data Types & Limitations
Attempting to set the value of a column in SharePoint that requires a specific data type such as a List Item ID, date or filename (Name) will result in a Workflow error when the incorrect data is assigned to a field/column in the list item or document. When developing workflows using SharePoint Designer, restrictions have been implemented to help ensure that the correct data type is used when setting workflow variables or fields in a list item. For example, when setting the value of a date/Time field, only a date variable or field can be set as the new date value. Similarly, when working with list items in SharePoint from a workflow, SharePoint Designer uses the List Item ID data type when retrieving or storing the ID of the current or another list item to ensure that only one (unique) item is returned.


Changing the name of Documents in a Document Library from a Workflow
- Difference between the "Name" and "Name (for use in forms)" fields
- Illegal / Special Characters in Document Filenames causing workflow errors.
- How to use calculated columns to remove illegal / special characters from a date or other field to be set or included in the document filename.

The "Name" and "Name (for use in forms)" columns in a SharePoint document library both refer to the same data, being the filename of the document of file, but function differently when updated by a Workflow Developed using SharePoint Designer. The main difference when using the Name columns in a Workflow is that the file extension for the document is included when using the "name (for use in forms)" column, but not the "Name" column.
  • Name - Doesn't include file extension
  • Name (for use in forms) - Includes file extension
When setting the value for the "Name" or "Name (for use in forms)" fields, special / illegal characters need to be considered, as the workflow will stop with an "Error updating a list item" error, with the outcome "Unknown Error". This is due to the fact the SharePoint doesn't allow specific characters to be included in the Name (filename) of a document stored in a Document Library. See Illegal Characters in SharePoint Document Libraries for more information about non-supported special characters for filenames in SharePoint.

Use calculated columns to format the created date to be appended to the filename (Name) of a document or form:

1. Configure a calculated column on the Sharepoint document library that formats the created date as a string with no illegal / special characters, that can then be included in the filename of the document.
Calculated Column: Generate a text string containing the created date in a specific format (dd-mm-yyyy : 03-02-2010)

=TEXT([Created],"dd-mm-yyyy")

2. Configure a workflow to append the value from the calculated column to the "Name (for use in forms)" fields of the document.
To append the date to an existing filename, you will need to use the value from the "Name" column, as it will not include the file extension. You would do this using the "Build dynamic string" workflow action, which would first take the original filename (without the file extension), then append the value from the calculated column containing the formatted date. The file extension can be included in the new filename string, but is not required. Once the new filename have been generated, you can set the "Name (for use in forms)" field for the current item using the "Update list Item" action, or the "Set field in current item" action.

Related:
Troubleshoot workflow errors

Access Denied when trying to upload multiple files to a SharePoint Library when one of the files contains an illegal character.

Monday, January 25, 2010

How to configure a workflow to start at specific time, then loop / repeat periodically (Daily, Weekly)

The following method can be used to start a workflow at a specific time, then repeat periodically (each day).

Periodic Workflow Processing (send daily email notification or reminder)
A useful implementation of this technique allows you to configure workflows to run as background tasks at a specific time instead of being triggered by a user manually, or after creating or modifying a list item. This allows processing of data from SharePoint to take place during times when the SharePoint environment is not being used as well as performing tasks that take a long time to complete.
For example, this method can be used to configure a looping timer workflow to run at COB each day (5:00pm) to perform calculations and processing on a list item before emailing a reminder, or details to a user associated with the list item or document. When initiated for the first time, the workflow waits until the specified time (5:00PM) before executing workflow actions. After the workflow is complete, a secondary list item is modified, which in tern initiates a new instance of the workflow. As the initial time (and date) that workflow waited until to start would have passed by the time the workflow is started the second time, the workflow waits for a specified period of time instead (eg. 1 day) before completing the workflow actions. The result is a looping timer workflow that starts at the time specified, then repeats on a periodic basis (every 24 hours / daily) indefinitely, or until certain criteria is met.
As the repeating sequence only needs to be initiated once, this method can be used to build workflows to complete background processing to help minimise the impact on users, as well as improve usability and functionality of web applications created using components of SharePoint. See below for an example of a Looping Timer workflow used to complete processing as a background task at a specific time each day.

Looping Timer Workflow for Background Processing
When a workflow takes time to process but doesn't require user input or intervention, it is possible to configure the workflow to run as a background process to eliminate the need for users to initiate the workflow each time it is required, as well as allowing complex and timely processing to be completed "behind the scenes". As these workflows may take a long time to complete forcing a user to wait for the workflow to complete after manually initiating, or modifying / adding an list item to a list to initiate the workflow can result in frustration if there are long delays. Configuring workflows such as this to repeat periodically allows the workflow to start and finish in it's own time, eliminating the need for SharePoint users to initiate and control the workflow. Other workflows initiated by users can then refer to the data generated and stored by the looping workflow allowing them to complete in a short amount of time as no complex or in-depth processing is required to complete the operation.
The looping workflow sequence is initiated once, then repeats indefinitely or until a specified date if required. The workflow will complete the operations required for each iteration, then pause until the operation is to be executed next. This will mean that the workflow will continue to complete the processing without a user needing to manually initiate a new instance of the workflow. A common implementation of this technique may be to send a daily or weekly email report or reminder with details of a list item or data from many lists and items similar to the example above. Other scenarios where this can be utilised are times when workflows are used to process many list items, as well as perform calculations and other operations on the list items that require time to process. With scenarios such as this, configuring a looping timer workflow to automatically initiate and complete the processing at a specific time each day (or hour) eliminates the need for a user to have to initiate the workflow, as well as allowing the workflow to complete seamlessly to users in the background.



Example: Daily Sales Report Workflow using SharePoint
Calculate sales totals for the current day's invoices. Store the data in a separate "Reports" list item for the day.
A looping workflow may be configured to loop through each item in a SharePoint list (Invoices), then extract data from a specific field from each list item which is the added (concatenated) to a field in a secondary list item (Invoice Reports) for other workflows to refer to, or later use by SharePoint users. The workflow would process all Invoices which have not yet been processed, which will be any from the current day, as invoices from previous days will already have been processed.
A looping timer workflow can be configured to run at a specific time, then repeat every 24 hours to initiate the workflow(s) that loop through all items in a SharePoint list. The looping timer workflow will initiate the looping workflow to process invoices each day. A looping workflow can sometimes take a while to complete if there are a large number of items in the list. Configuring the workflow to be initiated by a user may not be appropriate as the delay may reduce the effectiveness of the workflow and increase user frustration. Configuring a timer workflow to initiate the workflow loop allows the processing (of all items in a list) to complete in isolation to workflows initiated by users that refer to the data generated when processing all list items.
Depending on how often the data changes and how important it is that the data is up to date, you may need to configure the looping timer workflow to initiate the workflow to process all items at shorter intervals (eg. hourly, every 10 minutes, etc.). As long as the list containing the items being processed is separate to the list item that stores the data from all items, it would also be possible to initiate the workflow loop to process all items when any of the items in the list are updated or added. If configured this way, an "On Change" and "On Create" workflow would initiate after a list item is added or modified, which would then make a change to the secondary list item to initiate the workflow loop sequence. The loop sequence would then process each item in the list until complete.
See below for a breakdown of a Background Processing Workflow that repeats daily using the above example.


Looping Processor / Looping Timer Workflow
Components (Daily Sales Report):
SharePoint List: Invoices
- Invoice 1
- Invoice 2
- Invoice 3
The "Invoices" list is the list which contains the items to be processed. Each item / "Invoice" ion the list is processed to calculate daily sales totals for each staff member.

Invoice Reports
- Report xxx (20-01-10)
- Report xxx (21-01-10)
- Report xxx (22-01-10)
This "Invoice Reports" list contains one list item for each day. The report data from each invoice item for the current day will be added to an Invoice Report item in this list once all have been processed to calculate sales totals.

Workflow Control List
- Temporary items used to initiate and control workflows and the looping functionality.

Workflows:
- Invoice Processing Workflow
- Initiate Invoice Processing Workflow
- Invoice Processing Timer Workflow


Looping Timer and Background Processing Workflow Diagram:
(Click to enlarge)


























Workflow Details:

1. Invoice Processing Timer Workflow
This workflow will commence at a specified time (eg. 6:00 PM), then repeat every 24 hours (daily) after the first instance has completed. This looping timer workflow will be used to initiate the "Initiate Invoice Processing" (Looping Timer Workflow) at the end of each day by creating an item in the Workflow Control list with the title "Start Report Loop". This "Invoice Processor Timer Workflow" workflow will only need to be initiated once, as it is configured to automatically trigger a new instance of the workflow each day. When configured using SharePoint Designer, one of the first steps in the workflow would be to test if the current time is before or after the start date/time for the workflow (specified in a "start_date" field in the list item).

2. Initiate Invoice Processing Workflow: (Looping Timer Workflow)
The purpose of this workflow is to initiate an instance of the "Invoice Processor Workflow" on each item in the list being processed. The workflow will initiate when an item is added to the Workflow Control list with a specific title (eg. "Process Next Invoice"). The workflow will find the first unprocessed item available list item from the Invoices list, and update a field which indicates that it is being processed ("Processed" = no/false). Updating the field will initiate the On Change workflow (Invoice Processor Workflow) to process the updated item.

3. Invoice Processing Workflow
Process an item from the Invoice List. A separate instance of this workflow will be initiated for each item in the list each time the looping workflow sequence is executed. Updates the item from the invoice Reports list with data from each Invoice (daily totals: sales, turnover, profit, sale type, compute staff rank based on total profit, etc.).


Workflow Control List & Workflow Triggers
The workflows associated with the Workflow Control List Invoice Processing Timer (1), Initiate Invoice Processing (2) ) are should be configured to start when a new item is added to the list. The first step of the Invoice Processing Timer (1) workflow will be to stop the workflow if the Title of the current item (item added to the list) is not equal to "Start Report Loop". This will mean that other items added to the workflow control list with a Title that isn't "Start Report Loop", won't initiate the Invoice Processing Timer (1) workflow unnecessarily. The Initiate Invoice Processing (2) workflow should have a similar configuration for the first step: Stop if the Title of the current item is not "Process Next Invoice". This will mean that only items with this title will continue into the remain workflow steps.

The Invoice list will need a column/filed to flag if the Invoice has been processed or not. This could be a hidden boolean (true/false) field "Processed" or similar, which would be set to No/false as default when an Invoice is added to the list. The "Processed" field would be used by the Initiate Invoice Processing (2) workflow to find the next Invoice item to be processed. The unprocessed Invoice item found should then be updated by setting "Processed" to yes/true, which will then initiate the Invoice Processor (3) workflow for that Invoice. The final step of the Invoice Processing (2) workflow after initiating the next Invoice Processor workflow in the sequence can be to remove the current item ("Process Next invoice"), as t is no longer required. The final steps of the Invoice Processor (3) workflow should be to create a new item in the Workflow Control list with the title "Process Next Invoice", which will re-initiate the Initiate Invoice Processing (2) workflow creating the looping functionality, then set "Processed" to yes/true.

As the workflow is scheduled to run every 24 hours, items in the Invoices list from previous days will already have been processed by previous instances of the workflows. Only invoices added to the Invoice list since the last time the Report workflows were run, which will be any from the current day.



Related:

SharePoint Looping Workflow - How to: Loop through and process all items in a list
To use SharePoint workflows to loop through all items in a list to perform calculations, process and update metadata values, or concatenate the value of a specific column in all list items into a single string.

How to get an SPD Workflow to Run at a Specific Time – Employee Vacation Reminder: Part 5

(Looping) Timer Workflows Using SharePoint
Looping timer workflow (eg. send a daily notification/reminder until a specific condition is met.

Sunday, January 24, 2010

SharePoint Designer: Get account details of the user who initiated the workflow using OOB Workflow Activities

Get account name of the user who initiated / triggered a workflow using OOB SharePoint Designer Activities:
The ability to access the account details of the user who started a workflow in Sharepoint is not supported when developing workflow using SharePoint designer and OOB workflow activities. The User data type allows selection of the User who created the item, but not the user who initiated the workflow. Using the Modified By field will return the user who made the most recent changes to the document/list item or meta data, but may not be the user who initiated the workflow. For example, if a workflow is used to set the approval status of a list item or document with content approval enabled is initiated, the user who published a major version of the documnent (submit for approval) will be the user who initiated the workflow regardless of who made the most recent changes to the document.

A number of solutions relating to this issue / limitation are available, including a workaround solution using OOB workflow activities and SharePoint designer explained below:

How to get the account name of the user who initiated a workflow using OOB workflow Activities and SharePoint designer:

1. Create/modify item in secondary list.
This action will be executed using the credentials of the user who initiated the current workflow. Once the list item from the secondary list has been created or updated, you can then retrieve the Creaded By or Modified By user.

2. Pause, then store the user who created/modified the secondary list item in a Workflow variable (string: "DOMAIN\user").
After the secondary list item has been created or modified, you can store the value of either the Created By or Modified By fields of the secondary item to get the account name of the user who initiated the current workflow. Note that you may need to configure the workflow to pause for 1 minute after creating or modifying the secondary list item, as it takes a few seconds for the account details to become available after creating or modifying the item.

3. Use the value of the workflow variable.
Once you have stored the user who started the workflow in the workflow variable, you can then use the value when setting the Assigned To, email recipient or any other field that uses the user account data type.


Related:

In sharepoint designer’s workflow editor how do I get the workflow initiators username?
"In Sharepoint designer's workflow editor I wish to retrieve the username/name of the work flow initiator (i.e. who kicked it off or triggered the workflow) - this is relatively easy to do using 3rd party products such as Nintex Workflow 2007 (where I would use something like {Common:Initiator}) - but I can't seem to find any way out of the box to do this using share point designer and MOSS 2007."

Wednesday, January 13, 2010

SharePoint Looping Workflow - How to: Loop through and process all items in a list

Objective
To use SharePoint workflows to loop through all items in a list to perform calculations, process and update metadata values, or concatenate the value of a specific column in all list items into a single string.

Background
The OOB workflow actions provided by SharePoint don't allow a loop to be configured explicitly. Instead, a number of workflows can work together to create a looping affect. Another limitation of Workflows in SharePoint using SharePoint Designer (SPD) is the inability to simply test if the user who initiated the workflow is a member of a SharePoint group, or to test if the value of a field in the item which initiated the workflow is equal to the value of a specific field from any item in a separate list.

For example, the OOB Approval Workflow requires that a user who is an Approver of changes to approve their own changes each time a modification is made. In many cases, Approvers are also the users who make many of the changes that require content approval which can result in the user wasting time and becoming frustrated when many documents/items need to be updated. To simplify the workflow, you could loop through each item in a separate list that lists each of the users who are approvers to check if the user who initiated the workflow is an Approver. If the user is an approver, the Content Approval Status of the item can be set to "Approved" making the changes visible to other users. The list of approvers would been to be stored in a list instead of a SharePoint group, as SharePoint Designer doesn't allow you to test if a user is a member of a group. Storing the list of approvers in a SharePoint list allows you, or someone else to easily add/remove users from the list. Note that the users added to the approvers list would still require the appropriate permissions applied to approve changes. To loop through the items in the Aprovers list, a looping workflow would need to be configured to process each item in the list.


How To Create a Looping Workflow in SharePoint

A number of lists will, along with multiple workflows configured to trigger each other will be used to create the looping workflow. As there is no option when developing OOB workflows using SPD to loop through items in a list, a separate workflow will be configured to perform the required actions on a single item. This workflow would start when an item is modified, completing the required actions/processing for the item. When complete, the "Item Processor" workflow will re-initiate the parent workflow which will then initiate a workflow to process the next item in the list. A custom Boolean (True / False) field "Processed", or similar will be added to the list that contains the items that need to be processed. This field will be used to find and trigger the workflows to process each item in the list once.

When all items in the list have been processed, the workflow not be able to find the next item in the list based on the specified criteria and as a result will cause the "List item not found" error and the workflow will stop.

As new instances of a workflow won't always start if there is another running instance that has an error, the parent workflow will be initiated each time by creating a new item in the Workflow Control list. The parent workflow can remove the workflow control item once it is complete to help keep the SharePoint lists tidy.


Considerations & Limitations
If Service Pack 2 or higher has been installed on the servers hosting SharePoint, workflows will function different to an environment at the SP1 level or less as after SP2, an "On Change" workflow won't re-initiate itself when the current item is modified. This can affect looping workflows, as they may have been configured to loop by updating the current item. The looping workflow solution detailed below should work on servers with or without SP2 installed.

Looping Workflow Components

Lists/Libraries:


Items - The list containing the items you wish to process using a loop.
The Items list will need to have a Boolean column/field added with a title "Processed" or similar, which will be used to create the looping functionality as well as to determine if an item in the Items list has been processed or not.

Workflow Control - The list to initiate and control the workflow loop. Use a custom list for the Workflow Control list, as the title of Workflow Control items will be used to help control the Parent workflow.

Workflows:

Item Processor:
- Associated with the list of items you wish to process.
- Starts when an existing item is modified.

Workflow Control:
- Associated with the Workflow Control list.
- Starts when a new item is created.


Looping Workflow Sequence:
Each step in the following sequence should be interpreted as a step in a Workflow created using SharePoint Designer. Step 2.2 (Items Processor) can be configured in as many workflow steps as required to complete the processing for an item. It is important that the remaining steps are configured and executed in the sequence below.

Workflow Control (Parent) Workflow (1):
1. Item created in "Workflow Control" list initiates parent workflow.
1.1 - Update the "Processed" field from an item in the "Items" list to No/false: find the item by searching for an item in the list where "Processed" = Yes/true
1.2 - Remove the current item as it is no longer required.

Items Processor Workflow (2):
2. Workflow starts when an Item is modified by Parent Workflow (Processed = No/false)
2.1 - Stop if "Processed" = yes/true (Prevent instances of the workflow running when they are not supposed to, if a user makes a change in the item which triggered the Item Processor workflow).
2.2 - Complete processing/actions required for the current item.
2.3 - Create a new item in the "Workflow Control" list to continue the workflow loop.
2.4 - Pause for 1 minute (allow the remaining items in the list to finish processing)
2.5 - Set Processed = Yes/True : Reset the item for next time it needs processing.

Looping workflow diagram (Click to enlarge):
Looping workflow diagram


















Looping Workflow Details:
1.1 The parent workflow starts when an item is added to the Workflow Control list. All the Workflow Control workflow needs to do then is update the value of the "Processed" field in of an item in the "Items" list, by finding the first item where "Processed" equals Yes/true. This will initiate the Items Processor workflow for first item found that matches the criteria. The current item in the Parent (Workflow Control) list can the be removed as it is no longer required.
1.2 - Once an Items Processor workflow has been initiated, the current item in the Workflow Control list is no longer required and can be removed. Once all items in the "Items" list have been processed, Step 1.1 of the Workflow Control workflow will have completed, as it will halt with the "List item not found" error, which will result in one (the last) item in the Workflow Control list to remain.

2.1 When the Items Processor workflow is initiated after a Parent workflow sets the "Processed" field to Yes/true, the first step is to test if the Processed field equals yes/true, and stop the workflow if it does not. This prevents the workflow from initiating out of the looping workflow context. If using SharePoint with SP1 or lower, the final step of the "Items Processor" workflow (Setting the "Processed" field back to Yes/true) can cause an endless loop. Stopping the workflow in the first step if Processed doesn't equal Yes/true will prevent an endless loop.

2.2 The next step(s) of the items Processor workflow complete the actions or processing required for the current item. This may include adding up the value of a numeric field to find the total for all items in the list, or concatenating the value of a field in from all items in the list into a single string which can then be used to perform more complex tests/tasks based on data from multiple items. If calculating or generating a single value or string from data from all items in the list, you will need to store the results of the calculations in a separate list item that each workflow would refer to and update after completing the processing for an item. For details of an implementation of this example, see the article How to wait for a change in any list, wait for multiple field changes in the current item (SharePoint Workflow) (Test if an item exists in a list with certain criteria, continue workflow if not and create a new item in the list with the specified criteria).

2.3 Creating a new item in the parent "Workflow Control" list re-initiates a new instance of the parent workflow, which will find and initiate the Items Processor workflow on the next item in the Items list that has not yet been processed.

2.4 Pausing for 1 minute allows the remaining items to be processed by the looping workflow sequence. After pausing for a minute, the "Processed" field in the current item is set to Yes/true to indicate that the item has been processed. This will also prevent further instances of the workflow initiating unless by another (new) instance of the entire looping workflow sequence.


Related Articles:
How to wait for a change in any list, wait for multiple field changes in the current item (SharePoint Workflow)
Test if an item exists in a list with certain criteria, continue workflow if not and create a new item in the list with the specified criteria

(Looping) Timer Workflows Using SharePoint
How to create a looping timer workflow (send a daily notification/reminder until a specific condition is met)

Thursday, January 7, 2010

SharePoint Forums, Blogs and Online Communities

SharePoint Forums

The following page provides a comprehensive list of websites hosting popular forums relating to SharePoint. Learn how to customise, develop and administer SharePoint environments from industry experts by browsing through existing threads, or by posting a new thread if you have a question which hasn't been answered in one of the forums. All of the forums listed are free to join and contribute.

Forums relate to WSS, MOSS 2007 and SharePoint 2010, and include the official Microsoft product and Technologies and other forums such as the SharePoint Development & Programming, SharePoint Setup and Administration, SharePoint Design and customisation.


SharePoint Blogs

The SharePoint Blogs listed on the page are predominantly SharePoint MVPs, with years of experience, and many useful articles, tips and tutorials to help when customising, developing and administering SharePoint.


SharePoint Groups

There are many groups (newsgroups) available that contain information, and references to other useful information and resources that can help when customising, developing or administering SharePoint. The groups provided on the following page are moderated to ensure that inappropriate or illegal content, including spam is not added to the groups.

Wednesday, December 16, 2009

SharePoint, Web Programming & SEO Resources

Web-Resource.org - SharePoint, Web Programming & SEO Resources

Web-resource.org provide a range of resources from around the web for Web Development & Programming, SharePoint & InfoPath Development and Search Engine Optimisation. Resources have been hand selected by the team at Web-Resource.org, and suggested by users.


SharePoint & InfoPath Resources

A range of tools and resources are provided by Web-Resource.org for Administering, Designing, Customising and Developing a SharePoint environment. Resources include a range of articles with tips, how to's, tutorials, third party utilities for administering and developing SharePoint. Tutorials are also available to help with InfoPath form development and integration with SharePoint.
SharePoint Design & Customisation resources include tutorials for creating and customising Data View Web Parts to display data from SharePoint lists which is formatted based on metadata values for each list item. This includes the ability to format rows of a task list for example, to set the background or text colour of the task item to a color which represents the priority or amount of time until due. The articles specifically describe how to format tasks based on the due date and other fields. An overdue item can be formatted with a red background and bold text. Items which are due within three days are formatted orange, 1 week: yellow, 1 month: green. When the conditional formatting is combined with sorting and grouping, a Data View can display a large amount of information in a logical and readable format.

SharePoint Administration resources include tips and techniques for configuring SharePoint environments of various sizes, migrating content and configuration databases, tips and techniques to help when troubleshooting errors and issues with a SharePoint environment and much more. Other administrative tips and resources include configuring profile imports for multiple Active Directory domains, installing and registering custom web parts assemblies to be used on Web Part pages.
InfoPath form development resources include tutorials for creating and using Data Connections to lists on SharePoint sites from the InfoPath form. Tips and tutorials to help with the management of form templates and content types in SharePoint are available, including troubleshooting outcomes and information relating to using InfoPath forms as the Interface for SharePoint systems which comprise of many lists, libraries and workflows.
Web-resource.org also provide a section for SharePoint & InfoPath Forums, Blogs and Communities which all contain many resources to help you learn SharePoint and InfoPath. Go to the SharePoint Forums, Blogs & Communities section. Go to the InfoPath Forums, Blogs & Communities section.
View the SharePoint & InfoPath Resources on Web-Resource.org:
Other sites providing SharePoint / InfoPath Resources:


Web Development & Programming Resources

The Web Development & Programming resources section contains useful tools and resources for developing websites and web applications, and using various programming languages to customise and integrate different systems and software. Programming languages include PHP, Web Application Development, HTML, CSS, JavaScript, ASP.NET, XML, VB, .NET Framework and more.
A section for free Php Scripts provided by Web-Resource.org and from around the web. The php scripts provided by Web-Resource.org include a free Php RSS 2 Writer script, which can be used to generate an RSS feed from website or database content. Create your own RSS feeds for your site with php.
Popular Web-Development & Programming Forums, Blogs and Communities are also listed available under the Web Development & Programming Resources section of Web-Resource.org

Other recommended Web Development & Programming sites and resources:



Search Engine Optimisation (SEO) Resources

Increase traffic to your site by optimising for Search Engines. Web-Resource.org provide a range of tips, tools and resources for getting started with optimising websites for Search Engines. Boost traffic to your website using various link building techniques and tools which are sometime known as offsite optimisation. Information about onsite optimisation tools and techniques for web & search engine marketing is also provided, including SEO & Search Marketing Tips to help improve your site ranking in Search Engines.

Resources include a SEO Forums and Communities section, which provides a list of some of the popular networking sites and tools to help with learning and applying Search Engine Optimisation techniques to a website.

Other sites providing SEO Tools & Resources:
Free SEO - Bulk Ping
Web Marketing Tips
SEO Tips for Blogger

Monday, December 14, 2009

Where is SharePoint web.config?

There is a separate web.config file for each Web Application / IIS Website which is running an instance of SharePoint. For example, if Sharepoint, Central Admin and the MySite host are all running as separate Web applications (different Application pools) on separate IIS sites, there will be a web.config file in the root of the virtual directory for each application. There is also a separate web.config file which contains configuration details for the "_layouts", "_catalogs", etc directories of SharePoint sites.

You should not make changes to the web.config file in a production environment, or while in production. Back up your entire SharePoint environment, including all databases prior to commencing any major troubleshooting or configuration changes. You should attempt and test any modifications to the web.config file in a non-production environment which is configured the same as the live environment. Once you are confident the the changes apply the necessary changes if required to the live environment while it is not in use. The IIS Website will automatically reset when the web.config file is saved so changes will be applied immediately. Be sure that you have not left syntax or any other errors in the file before saving changes.

The web.config files are genearally found in the following locations:

  • web.config file in the root folder of each virtual server / IIS Application.

Local_Drive:\Inetpub\wwwroot

This is the usually the file that contains most of the web configuration of a SharePoint site collection. To display full errors you would need to modify this web.config file. There may be one for each of the SharePoint applications running in some cases (MySites, Multiple Portals or Instances of SharePoint, Central Admin, etc.). If this is the case, you will only need to modify the web.config file which is in the root of the virtual directory for the instance of SharePoint which you using. To find out which directory is used by various SharePoint applications/websites, view the properties of the SharePoint website in IIS and from the "Home Directory" tab, the value in the "Local path" field will take you to the directory where the web.config file is for the specific instance of SharePoint / Application in IIS.














  • web.config file used in Web Part resources for the Global Assembly Cache (GAC)
Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources

  • web.config configuration file(s) for extending other virtual servers
Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\CONFIG

  • web.config file which defines configuration settings for the /_vti_bin virtual directory
Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI
  • web.config file which defines configuration settings for the /_layouts virtual directory
Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS

  • web.config configuration file for Central Administration pages.
Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\ADMIN\Locale_ID