MOSS Custom Workflow Reporting/Logging

27 03 2009

This is an idea I had recently about workflow logging within SharePoint –

When it comes to workflow event logging – SharePoint has a number of limitations:

The OOTB ‘Workflow History List’ is very un-user friendly, it also can only be accessed through a number of menus from the list item itself. In addition there is a scheduled cleanup job which cleans out the workflow history of items that are over 60 days old with no workflow running on them.

To get round this there is another option, log to a custom list from the workflow:

  • Log the event/description and perhaps an incremental ID number to determine which order the events occurred in to a custom list within the SharePoint site
  • Report on this list using SQL Reporting Services

SQL Reporting Services can be configured to get data from SharePoint lists so this makes it ideal for a workflow report/audit. This will make much more sense to end users and they will not be confused by the workflow history list.


Ten Themes for MOSS/WSS

25 03 2009

I was looking around on the net for some downloadable themes for WSS or MOSS and found these –

This is a pack of 10 themes provided by Microsoft as a download. The download contains each theme as a Visual Studio 2008 project. If you open each one with Visual Studio and deploy it, a .wsp will be created allowing easy deployment to any WSS/MOSS Server. Screenshots of the themes included can be found below:


Quest Reorganization Wizard Beta

23 03 2009


Dear Readers,

Thought I would point you towards this incredibly useful tool from Quest Software that Ilia Sotnikov (see his blog here: told me about.

It is a BETA version of the Reorganization Wizard feature that will be included in the upcoming version of Quest Migration Manager for SharePoint (

This tool is incredibly powerful and allows you to overcome some of the major limitations of both MOSS & WSS. Using this tool you can achieve the following:

  • Move/Reorganise SharePoint Subsites (e.g.Moving a Subsite to a Site Collection) – whilst keeping all custom Metadata and Auditing data.
  • Move Site Collections within the same SharePoint Farm
  • Promote parts of a site tree to a new site collection on the same or different web application
  • Optimize SharePoint database storage by moving site collections between content databases
  • Perform cascaded site deletes to finalize the site move or roll back a failed operation

We have been using this Beta version to move some subsites around in our WSS farm. I was impressed with the fact that the move keeps the Auditing data as an STSADM Import/Export normally erases this.

You can download the tool from the following link –

Well done Quest Software and thanks Ilia!

MOSS 2007/WSS 3.0 Backup & Restore – Limitations

17 03 2009

Hi all,

I realise I have not blog posted for a while now, I have been very busy working on moving and restructuring a load of WSS 3.0 sites & subsites. Whilst doing this I have run into a number of problems so thought I would post my findings here:

  • The STSADM –o backup and STSADM –o restore commands do not work with individual subsites. You can only backup a top-level site collection and restore this. It does backup child subsites beneath the site collection however.
    • Using STSADM –o import and STSADM –o export works for backing up an individual subsite but it does not keep any of the Metadata. This means that the ‘Modified By’ and ‘Modified Date’ are lost for all documents on the site, these columns are simply set to the System Account and the date that the import occurred. It seems that SharePoint treats this command almost like a copy on a file system.
    • Subsites/Site Collections can be backed up and restored using SharePoint Designer but this again does not retain any of the Metadata.

In addition to the above, we ran into a problem when first trying the export and import of a subsite, we received an error message saying –

“Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)”

This is a well documented error, to fix it we had to edit the ‘Fields.xml’ and ‘CTypes.xml’ files in the directory C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\TSATypes”.

It suggests that the above two XML files contain illegal curly brackets.

We made a backup of the Fields.xml and CTypes.xml files and used notepad to replace ID=”{ with ID=” and }” with “. After editing the files we performed an IISRESET and voila, we could successfully import and export sites.

Hope this helps other people and answers some questions! 🙂

Updating InfoPath promoted column in MOSS from Workflow/Application Page

11 03 2009

This is something I have been having problems with for ages and thanks to Chris Jones I have now found the solution.

If you try to update the value of an InfoPath promoted column within MOSS (from a workflow/application page or other) you will notice that the item[“fieldname”] = “Something” method does not work.

This method works fine for normal SharePoint columns but when it comes to InfoPath promoted fields/columns, it simply will not update the column at all.

Chris has posted some code on his blog which I can confirm updates the column within MOSS and on the form itself, it basically opens the xml document, navigates to the particular data to update and then saves the document back to SharePoint.

Chris modified this code from a forum post but could not find the original author so thanks to them too!

You will need to pass in the XPath of the field you wish to update and the URN of your form.

See Chris’s code here:

In addition to the code on his blog you will need the following code showing how ‘_settings’ and ‘_incidentInfoDoc’ are loaded:


_settings.NamespacePrefix = “my” //

_settings.Namespace = “”

And _incidentInfoDoc is loaded like this

SPFile file = _workflowProperties.Item.File;

using (var streamReader = new StreamReader(file.OpenBinaryStream()))


string content = streamReader.ReadToEnd();

_incidentInfoDoc = new XmlDocument();




Cheers Chris!

Event Handlers and Workflow – be careful!

10 03 2009

If you are using any custom event handlers on your MOSS document/form libraries then be careful that these will not interfere with any running workflows.

This caught me out, I have an event handler attached to the ‘Item Updating’ event of my form library. When an unauthorised user (not in an Admin group) attempts to update an item it will show them an error message.

I had neglected to realise that MOSS workflows run under the system account – ‘SHAREPOINT\\system’ and this user account was of course not in the admin group. The result was an error in the running workflow as it could not update the list item. I first tried to add the system account to the group but you cannot do this, I am assuming that’s because the system account cannot be locked down in any way.

The best way to get by this is to add a check in your event handler code to see if the user conducting the event is indeed the system account or not.

Here is the code I have used to check this:

CurrUser = properties.UserLoginName.ToString();

If (CurrUser == “SHAREPOINT\\system”)


//Do Nothing – User is System Account




//Your code here


Good luck!

WSS Cascading Navigation

10 03 2009

Dear readers,

We have been looking for a way of getting drop-down menus on the top Navigation bar in WSS for a while now. We figured we would need to create our own custom menu control etc, then one of my colleagues installed this Web Part:

This Web Part, created by Yvonne Harryman allows you with a few modifications to replace the standard navigation bar on the top of each WSS/SharePoint page, this new navigation bar gets its data from a WSS list. The list contains the link titles, parent links, display order and more. It even can go as far as only showing links for certain audiences.

I am very impressed by the Web Part so thought it deserved a link back, let me know what you think! 🙂