Itemupdating which wasn t handled

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.But that option exists to be used, and some people really do need it.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.

Later on, when you checked the document in, you would see those events fire again.

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.

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.

Leave a Reply