Itemupdating beforeproperties null
This is to summarize the inconsistent behaviors I encountered when working with "After Properties" in "Item Updating" event handler on a custom Share Point list in SP 2010.
1) After Properties will be NULL when Item Updating event is called because of a code-update to list: But, when the list is being updated by code, and the code does not update the "Email" (for example, the code just updates "First Name" in the list) then properties. To String() will have the correct look up value like "3;#karthik", but the value of properties. To String() will have only "3" (just the look up ID).
I have even tried to take get the value form "Item Uptading" to get the value before it updates. Has Published Version && after == SPModeration Status Type.
So the problem lies with the accessing of the parameter.
I had them flipping back and forth depending whether they were multi-select lookups, single lookups, or plain text/number fields.
However, it seems to be the case that not all fields on an item follow the same rules.
I've bound and Item Updating event to a document library of a MOSS publishing site, I’m then trying to compare the Before and After properties. I'm sure this is probably a subset so make sure you test.
Someone said there was a name like "vti_title" for the Title field that I will try but SHEESH.
In the link above you can go for a reference to find out which properties to use depending on what you are using a library or a list. Remember this, in most blogs it is written that you should use the Internal Name of the field, but for me it was different. Some of them had something altogether different because they still came up null for both the internal and display names.
It turns out that the problem I describe in this article ONLY occurs if the event receiver is NOT registered *using app authentication*, e.g. If the RER is registered using *user authentication*, e.g.
with the Share Point Online Credentials class, then you WILL see the behavior detailed here - so your choices then are either to register the RER with app authentication, or use the app-only approach detailed below in your code.
Event recievers are common in Sharepoint development so its better to understand the data available in each events.