Event itemupdating which wasn
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.
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.
I should also point out that I know the difference between a metaphor and simile in case that was bothering you from the opening sentence.
I am nothing if not a masterful linguist after a beer or two or more.
Sometimes that is the most exciting way to learn, but for those less adventurous I will briefly cover the topic here.
Fortunately, there is a relatively simple way to check whether the Item Updating and Item Updated events are firing in response to a check-in outlined in Knowledgebase Article 939307.
Damon gives just one example of a poisoned dagger in the game of Sharepoint Development: The Item Event Receiver.
I’m usually disappointed when writers employ oft-overused metaphors to describe a situation.
As such, if the item is being checked-in, the Before Properties will contain a value for the property and the After Properties will not.
It’s a pretty simple fix, but we can definitely make it a bit more reusable for everyone on a development team and reduce the hassle of having to remember the specifics about how to run the check in their Item Updating and Item Updated event handlers.