Itemupdating e getdatingtips org
You can think of an item event receiver like a database trigger: it has different events that fire during the course of Share Point running an operation on a list item (or document item).
Item Event Receivers derive from the SPItem Event Receiver class and have a number of methods that can be overridden to respond to various events: As you look through this list, you should notice that events have two types of endings: WARNING: One major gotcha you should know about the SPItem Event Receiver class is that while you can implement multiple list item event handlers in a single class, Share Point instantiates a new instance of that class for each individual event it needs to handle.
This is because you have two classes – one that is handling the Item Updating event and in which the instance level variable is set, and one that is handling the Item Updated event in which the instance level variable is not set.
Simply put, the Item Updating and Item Updated fire twice when adding a document to a library that has the Require Check Out option enabled.
If not, kudos to you for tackling the object model with reckless abandon.
Sometimes that is the most exciting way to learn, but for those less adventurous I will briefly cover the topic here.
The first time the Item Updating and Item Updated events fire it is in response to the document properties changing.
If you were to check the document out and edit the properties on the document, you would see the Item Updating and Item Updated events fire once.
I have a Doc Lib where I have some Metadata fields.
There is one field called “My Choice” which is a Choice type field with 3 values – “Choice1”, “Choice2” and “Choice3”. Now there is another field called “My Value” of Text Type.
My requirement is, if user selects Choice1 in the My Choice field, then the My Value field cannot remain blank.
This is not possible OOB, but can be done using a custom Item Updating event handler.