SPField Lookup Value old Lookup Value = new SPField Lookup Value(properties. To String()); SPField Lookup Value new Lookup Value = new SPField Lookup Value(properties. When setting a Date Time value in After Properties you have to convert the the Date Time to an ISO8601 string format.
However, this post only focuses on the Before Properties and After Properties of the list item event receiver (SPItem Event Receiver). The base class for all list item events is the class.
With the exception of feature events, here is a full list of available Share Point events, event receivers, and event hosts for quick reference.
This is what we have for lists: For both lists and libraries: No value means that column value in the hash table was not available.
New value means that the correct value for the column was available.
After Properties["Email"] will be NULL in the event receiver code.
After Properties will have the correct value, only when Email is also updated through code.
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).
There is a difference between the behaviour of Before and After properties when dealing with document libraries versus when dealing with lists.
For documents, Before and After properties are guaranteed for post events, such as Item Updated, but Before properties are not available for post events on list items.