Weird behavior of Post Synchronous ItemUpdated event attached to libraries in SharePoint 2010

This blog post by fellow SharePoint MVP, Randy Williams has always been a good reference for me when working with SharePoint 2007 event receivers. I have decided to test Randy’s finding against SharePoint 2010 and extend his great work by taking into account the newly introduced “Post Synchronous” events.

The following table summarizes how Synchronous, Asynchronous and Post Synchronous events work with lists and libraries in SharePoint 2010.

List BeforePropoerties AfterProperties properties.ListItem
ItemAdding No value New value Null
ItemAdded No value New value New value
ItemAdded – sync No value New value New value
ItemUpdating No value Changed value Original value
ItemUpdated No value Changed value Changed value
ItemUpdated – sync No value Changed value Changed value
ItemDeleting No value No value Original value
ItemDeleted No value No value Null
ItemDeleted – sync No value No value Null

 

Library BeforePropoerties AfterProperties properties.ListItem
ItemAdding No value No value New value
ItemAdded No value No value New value
ItemAdded – sync No value No value New value
ItemUpdating Original value Changed value Original value
ItemUpdated No value No value Changed value
ItemUpdated – sync No value No value Original value
ItemDeleting No value No value Original value
ItemDeleted No value No value Null
ItemDeleted – sync No value No value Null

 

 

No value –> column value in the hash table was not available.
New value –> the new value for the column was available.
Changed value –> the updated value was available.
Original value—> the original value was available.
Null –> the item is not available.

 

As you can see, in the Post Synchronous ItemUpdated event attached to a library ( not a list), the properties.ListItem[“AField”] returns the original value (the value of a field before the update occurs) and there is no way to get the updated value. I’m not sure if this is a bug or by design, I’ll check and get back to you very soon.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s