skip to content »

emp-rp.ru

Itemupdating e

To understand why this is happening, let’s first look at what happens when the user adds a document to the library when the Require Check Out option is disabled: So the net result of this is that the document is uploaded and the Item Adding and Item Added events have fired, which is pretty much what you would expect.

itemupdating e-53

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.Also note: the Item Updating and Item Updated events that fire in response to the properties being edited from the dialog will always occur, even if the user is not entering or changing any of the values.Turning off the Require Check Out option is a great quick fix if you don’t require the item to be checked out in order for it to be edited.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.It appears as though they are firing twice in this situation because Share Point is updating the properties on the document and then checking it in on the same request.

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.

Note: when the property editor dialog displays, the user has the option to cancel out of the dialog.

If the user opts to cancel, then only the Item Adding and Item Added events will have fired and the document will be left in a checked out state.

The first time the Item Updating and Item Updated events fire it is in response to the document properties changing.

The second time they fire it is in response to the document being checked in.

Unfortunately, that makes your project like the Titanic.