Tuesday, January 17, 2012

The importance of synchronous event handlers

Finally a good explanation on the issues we face with SharePoint 2010 compared with SharePoint 2007. We have a global unique document id which enables us to support quality requirements such as FDA 21 CFR Part 11 and ISO 9000. Everytime a document is added to SharePoint we give it a unique id and makes a MD5 hash of the metadata and document in order to prove that the document was indeed created on the specific date. When making a major approval, publishing, we run a workflow which prompts various users for a electronic signature which is stored with the document.

This works great in SharePoint 2007. We use ItemAdded to add the unique document id. However, we sometimes face some issues with SharePoint 2010. Obviously it is related to the timing om ItemAdded which is used. As it runs asynchronous we cannot be certain when the code is run - so sometimes we experience that the code is run and a unique document id is assigned to the document, but when we check the document afterwards the field is empty.

Setting ItemAdded to run synchronous solves our issue. Thanks for the hint.

No comments: