Sharing the experience search

Search sharing-the-experience.blogspot.com

Wednesday, March 9, 2011

SPItemEventProperties itemupdated beforeproperties is empty

Can't quite get where to use beforeproperties, afterproperties and properties.ListItem? Sometimes is null sometimes is just not you are expecting.
 Here is a neat table with what you should expect where and when in SPItemEventProperties class

Sharepoint List

Event
BeforeProperties
AfterProperties
ListItem
ItemAdding
Null
New  Value
Null
ItemAdded
Null
New Value
New Value
ItemUpdating
Null
Changed Value
Original Value
ItemUpdated
Null
Changed Value
Changed Value
ItemDeleting
Null
Null
Original Value
ItemDeleted
Null
Null
Null



Sharepoint Document Library


Event
BeforeProperties
AfterProperties
ListItem
ItemAdding
Null
Null
Null
ItemAdded
Null
Null
New Value
ItemUpdating
Original Value
Changed Value
Original Value
ItemUpdated
Original Value
Changed Value
Changed Value
ItemDeleting
Null
Null
Original Value
ItemDeleted
Null
Null
Null

3 comments:

  1. Thank you! It helped me a lot!

    ReplyDelete
  2. Great post!
    A simple but not obvious information.
    Saved a lot of time.
    Thanks!

    ReplyDelete
  3. I am getting null values in an itemupdated event, what could be wrong?

    ReplyDelete