Sharepoint Workflow Task Error: This task is currently locked by a running workflow and cannot be edited
By peter.stilgoe
Error in Event Log on Sharepoint Server: This task is currently locked by a running workflow and cannot be edited
When a workflow processes a task normally, the following sequence of events is expected to occur:
1. The process begins.
2. The workflow places a ‘lock’ on the task so nothing else can change the values while the workflow is processing.
3. The workflow processes the task.
4. The lock is released when the task processing is finished.
The error occurs because the lock never gets released, which usually occurs between steps 2 – 4. You can read more from this forum post.
http://connect.nintex.com/forums/thread/6503.aspx
Anyway I was getting this problem in a K2 Blackpoint / Blackpearl workflow which was preventing my workflow from moving to the next step. I resolved it by creating a new task list & pointing my K2 process to the new task list, no locking errors & the workflow runs fine now.
You may get similar errors with any workflow product ie. Nintex, Sharepoint Designer Workflow, C# Workflow etc, anything that uses the Sharepoint Workflow Engine & Sharepoint Task Lists.
K2 Blackpoint Blackpearl – How to update a Sharepoint list items using common meta data
By peter.stilgoe
In a K2 Sharepoint process you will quite often have to update the same piece of meta data in multiple locations ie. you have a status column which is part of the list your process is attached to but you may need to reflect this status update on another list item in another list for reporting purposes or something similar. Your lists will need to have a common piece of metadata like a ‘reference number’ or something similar in order for you to return the List IDs’.
You can do this fairly easily using the ‘Sharepoint Search’ event wizard in K2.
- Drop the Sharepoint Search Event wizard on to your design canvas
- Choose ‘Search in a Sharepoint List or Library’ this will just search the specific list your point it at
- Add the URL of the Sharepoint site where the list resides & pick the list you want to search
- Now specify you search parameters ie
Content Type: Order
Field: Reference Number
Operator: Equal
Value: Order Number (This column exists on your other list ie. the one attached to your existing process)
This is now searching your list for a reference number that matches the order number on your original list.
- Create a content field in order to store the results on the next screen
- Finish the process and save
- Now if you go into your process explorer you can browse your new content field that will contain the List ID of your item everytime your search event fires
ie. Object Browser –> XML Fields –> ‘Process Name’ –> ‘Content Field Name’ –> Items –> Item –> Item (This contains the List Item ID of the item you wish to update on the other list)
ps: I wrote this in a hurry which is probably apparent!
How to delete a corrupted Sharepoint list
By peter.stilgoe
Sometime you will find you have a currupted list that you cant delete through the normal way as when you try & access the list or the list settings the webpage throws errors. In this case use STSADM
stsadm.exe -o forcedeletelist -url http://devapp01/Lists/<MyListName>/
More From pstilgoe
Populate a Sharepoint list from an SQL Database
By peter.stilgoe
If you are wanting to populate a Sharepoint list from an SQL database or populate a SQL database from a Sharepoint list you can do this failry easily using SSIS & the SharePoint List Source and Destination Adapter project on Codeplex.
Introduction
This sample illustrates the creation of a a source and destination adapter in C#, using the public APIs for Microsoft SQL Server Integration Services. The component connects to SharePoint through a proxy dll, which wraps the complexities of working with the SharePoint Lists Webservice.
The Specific Features of the included SSIS Components are:
SharePoint Source Component
- Auto-detects all of the public fields from a SharePoint List or view of the list.
- Supports removal of fields from the output flow, which optimizes the query against SharePoint for increased performance.
- Supports restricting SharePoint data by a custom CAML query, which can be provided through a variable expression for fine tuned filtering over large lists.
- Provides a tuning feature for the # of rows to return at a time. Often with SharePoint, large lists need to be brought over in smaller batches than wide (many field) lists, or else the Webservice will die. The batchsize lets you specify a solid size that works for your list.
SharePoint Destination Component
- Auto-detects all of the editable fields from a SharePoint List
- Only fields bound to columns from the input flow will be ‘updated’, for performance.
- Supports deleting rows by ID
Included Bonus – SharePoint Utility
To simplify the adapter code and keep the SharePoint routines generic, a proxy VB.Net component is included which access the SharePoint Webservice API. It includes a very flexible api for getting SharePoint List information, which is used by the Components above. In addition, it can publish and remove files from a document library.
Component Features
Unique features that may inspire you to create great custom SSIS components:
• Extensive Validation: Validation for this component actively goes against the SharePoint Site to verify the properties are valid.
• Values from Expressions: This component supports external variables, which can be expressions, and can be attached to the source component to customize the query. Similar to the CommandText for the other Sql Components
• Linq: The Component has been written using Linq with .net 3.5 and shows how elements such as the metadata and columns can be combined to create a readable usage in a Linq format.
• Custom properties: The component keeps its configuration in custom properties on itself, inputs, and input columns.
• SharePointUtility Component: Simplifies access to the SharePoint Lists / Views WS using Linq friendly objects
Sharepoint List Source & Destination project on Codeplex
Sharepoint Designer could not save the list changes to the server
By peter.stilgoe
When using Sharepoint Designer 2010 to create custom aspx list forms I was getting the error:
‘sharepoint designer could not save the list changes to the server’
I had a look on the net but couldnt really find anything relating to do with this.
I seem to have solved it by going to my list and removing duplicate column names that werent being used ie.
Consultant
Consultant #Used in CT ‘Consultant’#
I was using a custom content type so I deleted all the columns that weren’t ‘Used by’ my custom content type. Once I had done this I was them able to create custom forms as expected in SPD 2010.
Hopefully this will help some people if theyre getting similar problems!
Populating an Infopath dropdown using a specific Sharepoint list view
By peter.stilgoe
If you have a Sharepoint list containing multiple views, one view shows all approved items and another view shows all items that are pending approval. You have an Infopath form where you have a dropdown control that you want to be populated with only ‘Approved’ list items from your Sharepoint list.
If you create your Infopath data connection & copy the URL to this list view as your source you will notice it still returns ALL items as opposed to your filtered view listing only the approved items.
The way round this is to create you data connection using an XML source, use this link to find out how to view your list data as XML and get the source URL – http://www.petestilgoe.com/2009/11/converting-a-sharepoint-list-into-xml/
Now you need to expand on this & add the particular view to the url to make the data connection get the filtered data for you.
Currently your URL looks something like this:
/_vti_bin/owssvr.dll?Cmd=Display&List={GUID}&XMLDATA=TRUE&noredirect=true
1) Now in your Sharepoint list click ‘Settings’ –> ‘List Settings’
2) Scroll down to the bottom & click on the view you want to use as your datasource
3) Now your URL contains the {List GUID} as well as the {View GUID}
eg. /_vti_bin/owssvr.dll?Cmd=Display&List=%7BD66DCB51%2D80B0%2D43AB%2DB80B%2DCD7D23E63B09%7D&View=%7B6D0CEF69%2DF899%2D40D0%2D86B2%2D6E01CC7D9CA1%7D&XMLDATA=TRUE
4) The URL is encoded so you will need to replace “%7B” with “{” and “%7D” with “}” and “%2D” with “-” so now your url will look something like
/_vti_bin/owssvr.dll?Cmd=Display&List={D66DCB51-80B0-43AB-B80B-CD7D23E63B09}&View={6D0CEF69-F899-40D0-86B2-6E01CC7D9CA1}&XMLDATA=TRUE
5) Use this url as your XML data source in Infopath and your drop down data will be filtered as per your chosen view.
More From pstilgoe
How to autopopulate Infopath fields using Sharepoint list data
By peter.stilgoe
1) Get your Sharepoint list into XML format
2) Set up a data connection using the above XML file as your datasource
3) Now you need to configure rules and filters on your list box. Let’s say that your list box has customer name and you wish to fill a field with the customer phone. When you set your rule, you would first select Set a field’s value then select the field where you want the phone number.
4) To filter for the correct phone number, select the formula button next to the Value field. In the formula window, select Insert Field or Group.
5) Select your secondary data source and the phone number field. Select the Filter Data button. Select Add.
6) In the first drop down, select the customer name field from your secondary data source. Leave the middle one set to Is equal to. For the third drop down, select the field on your form that is bound to the control with the customer name in it.
At this point, what you are basically telling the rule is: Go get me a phone number. I want it to belong to the same customer as the one I just selected in my List Box.
If your datasource is fairly static, when creating the data connection for the XML file in the Data Connection Wizard, ensure that the option to Include the data as a resource file in the form template or template part is selected. This will enhance the speed of your data queries to your datasource significantly.
Steps taken from Hilary Stoupa over @ InfopathDev.com
More From pstilgoe
Import Excel 2007 Spreadsheet as Sharepoint List Error Method ‘post’ of object ‘IOWSPostData’ failed
By peter.stilgoe
If you get the following error Method ‘post’ of object ‘IOWSPostData’ failed, you can fix it by doing the below:
Do a search on you C: drive for a file named: EXPTOOWS.XLA
Open it and Enable Macros
Select the Developer tab and the Visual Bacis or press ALT+11. Same result. You are ready to alter the file.
Search for:
lVer = Application.SharePointVersion(URL)
Add a new line just below:
lVer = 2
Save and exit.
Now try the import again & it should work.
NOTE: this is a problem with excel as opposed to Sharepoint so this would need to be done on all workstations requiring the ability to import Excel 2007 spreadsheets as custom lists.
More From pstilgoe
Allowed anonymous access on a Sharepoint list and still get prompted for a login
By peter.stilgoe
If you have enabled anonymous access on your Sharepoint farm and you still get prompted for a login when trying to access a list, it is most likely that your list exists in a ‘Publishing Site’.
This is because by default all publishing sites have a feature called ‘ViewFormPagesLockdown’ activated. This basically provides extra security for internet facing Sharepoint sites by stopping anonymous users viewing pages like AllItems.aspx etc.
If you want anonymous users to be able to view such pages you need to disable ‘ViewFormPagesLockdown’
1 Remove all anonymous access from the site.
2 Deactivate the ViewFormPagesLockdown Feature
3 Make sure that the list inherits its permissions from its parent.
4 Do an IISreset and close all browsers.
5 Wait 60 seconds or so for everything to start backup
6 Turn anonymous access on at the site level
7 Close the browser.
8 Browse to the website as anonymous user.
9 Click on a navigation link to browse to the list in question
10 You should now be able to browse list items as an anonymous user.
Activate Feature:
stsadm -o activatefeature -url
De-Activate Feature:
stsadm -o deactivatefeature -url
More From pstilgoe
Converting a Sharepoint List into XML
By peter.stilgoe
This easiest way is to use the URL below & insert your list GUID
http://servername/site/_vti_bin/owssvr.dll?Cmd=Display&List=*YOURUNIQUELISTID*&XMLDATA=TRUE
To get the GUID of the list you need to go into the list & click ‘Settings’ -> ‘List Settings’. Now if you look at your URL you will see something like:
/_layouts/listedit.aspx?List=%7B7B476F98%2D1075%2D4A6D%2D8F63%2D4C754B3F41FC%7D
The URL is encoded so you will need to replace “%7B” with “{” and “%7D” with “}” and “%2D” with “-” so the end result would look something like: {7B476F98-1075-4A6D-8F63-4C754B3F41FC}
More From pstilgoe
Import data from CSV and SQL to a SharePoint list
By peter.stilgoe
This SharePoint feature allows you to quickly import data from a CSV file or a SQL stored procedure to any custom SharePoint list.
Once you have added the solution to your farm and activated it on your site collection an additional menu option will be available on the Action menu of each custom list that will take you to the import CSV or SQL page.
Simply select which option you want – either import from a CSV file or import from a SQL stored procedure. Next, browse to the CSV file or enter the SQL connection and name of the stored procedure and hit the Import button.
There is a check box option to delete all items from the list before doing the import which is not selected by default.
More From pstilgoe
Charting Data From Sharepoint Lists
By peter.stilgoe
If you’re frustrated by the lack of charting ability in Sharepoint / MOSS take a look at Visifire
Using Silverlight, The Dataview Webpart & Visifire you can start charting your list data within minutes with some very smart charts!
More From pstilgoe
Creating an Org Chart using Visio 2007 and a SharePoint List
By peter.stilgoe
Many times during a project, you hit a requirement to have the ability to display an org chart on your SharePoint portal, and because there are many options to do this, it is difficult to know what approach is best for your particular scenario.
Here is a quick way of developing an org chart that the business users can update themselves! There are many options in terms of what data source you can use, such as Excel, MS Access, SQL Server or any OLEDB or ODBC data source.
For this scenario, we simply configure the Visio 2007 Org Chart to retrieve its data from a SharePoint List. The possibilities are endless in terms of how that data gets populated into the SharePoint List as well. For instance, you can write some code to retrieve and cleanup some data before programmatically importing it into the List.
More From pstilgoe
Turbo charge your sharepoint lists by using calculated columns to write HTML
By peter.stilgoe
By inluding html in your calculated column formulas you can turbo charge your lists in Sharepoint, see:
Using HTML in calculated columns
Adding traffic light system to Sharepoint lists>
More From pstilgoe
Sharepoint and JQuery
By peter.stilgoe
If youre not already using JQuery in your Sharepoint environment Im sure you will be in someway in the future, to get you started heres some useful links:



April 1st, 2011
