Itemupdating event receiver

The problem is that the Item Updated event in this custom Event Receiver will fire twice under certain circumstances--such as having require document checkout set on the Documents library.In my case, users do not load documents directly to the site.

I’m usually disappointed when writers employ oft-overused metaphors to describe a situation.

With that in mind, Share Point 2010 is like a sea of icebergs – there is a lot going on under the surface that you may not notice until it’s too late.

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.

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).When dealing with event receivers in Share Point custom code, we use the Before Properties and After Properties to get a hash table of properties consisting of string/value pairs that correspond to fields in the SPItem object before and after the event occurred respectively.Share Point has a built-in infrastructure that allows certain SP objects to raise events that can be handled by custom code.I made sure that the event receiver was not registered twice using the Share Point 2010 Manager tool.I made sure to Disable Event Firing() before creating the task item.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.

Tags: , ,