I always forget this and when I come to create a new SharePoint Event Receiver I wonder why the BeforeProperties or AfterProperties are sometimes not populated.
The Synergy MOSS blog has a really good post describing exactly what properties will contain a hash table and which will be empty depending on which list type the event is coming from and in which method (e.g. ItemAdding).
Be sure to check out the post here –
http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25
Here are the tables from the post:
These are the values of the properties in List events:
| List | BeforeProperties | AfterProperties | properties.ListItem |
| ItemAdding | No Value | No Value | Null |
| ItemAdded | No Value | No Value | New Value |
| ItemUpdating | Original Value | Changed Value | Original Value |
| ItemUpdated | Original Value | Changed Value | Changed Value |
| ItemDeleting | No Value | No Value | Original Value |
| ItemDeleted | No Value | No Value | Null |
And here are the properties available in Library events:
| Library | BeforeProperties | AfterProperties | properties.ListItem |
| ItemAdding | No Value | No Value | Null |
| ItemAdded | No Value | No Value | New Value |
| ItemUpdating | Original Value | Changed Value | Original Value |
| ItemUpdated | Original Value | Changed Value | Changed Value |
| ItemDeleting | No Value | No Value | Original Value |
| ItemDeleted | No Value | No Value | Null |
Hope this helps!







  

I’ve checked for Sharepoint 2010
For list:
ItemUpdating: No Values No Values Original Values.
ItemAdding – useless event. There no way to check the values in ItemAdding
Pingback SharePoint Event Receiver ItemUpdating Event and Hidden Columns | More Soma Please…
Alexey and Alex Clark you’re wrong.
http://blog.ray1.net/2011/06/getting-beforeproperties-and.html
Thanks for this – never knew you could set an event receiver as synchronous – oh well every day is a school day!
hi guys, i have a problem and i can´t find a solution for this…maybe you can help me.
my customer wants use windows explorer view to drag and drop SPListItems, at this point everything is OK, but he wants original values of “Modified” and “ModifiedBy” fields (in source list) be the same values in destiny list. the problem is when you are in windows explorer view and you do a dragNdrop action…modifiedBy field has the user logged in windows.
i have an eventReceiver for that destiny list to change this values overwritting “itemAdding” and “itemAdded” events and my code looks like :
if (listItem["Author"] != null)
{ listItem["Editor"] = listItem["Author"];
listItem.update();}
when listItem.update is running it through an exception saying windows logged in user has modified that item.
any ideas??? thank you very much
Also I believe you can get the properties for AfterProperties on the adding event for a list item but not a Document Library.
Hi Richard,
Yes that’s correct you can get the AfterProperties on ItemAdding but only for list items, quite annoying really as often I have needed this when working with a doc lib.
Thanks for the feedback.
Cheers
Alex
By the way – great post. I use it as a reference often
Hi,
Is it me or the table are the same ? This was not the case in the past (as we can see in blog that stole your content long time ago…).
Did you change the table to reflect the behavior or Synchronous Event ?
Edgar
Thanks alex… Helped me a lot…
Thanks for the overview, that helped me out.
Cheers!