I don’t mean that it’s largest and most luxurious application every written, but rather that you may be cruising headlong into a nasty rendezvous with an iceberg that could deal a severe blow to your project.We may never know about all of the dangers lurking out there, but today we’re going to cover at least one danger you may encounter while writing event receivers – an annoying issue with the Item Updating and Item Updated events firing twice.
Following is the code for a base class that adds a new parameter to the Item Updating and Item Updated methods that specifies whether the event was called as a result of a check-in operation.
These methods are just like the Item Updating and Item Updated methods in the SPItem Event Receiver class, but they have an additional Boolean parameter named is Check In that indicates whether or not the event is being raised as result of a check-in operation.
If you find yourself in this situation, then you’ll have to solve the problem in code.
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.
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.