I’m usually disappointed when writers employ oft-overused metaphors to describe a situation.With that in mind, Share Point 2010 is like a sea of icebergs – there is a lot going on under the surface that you may not notice until it’s too late.
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.
Unfortunately, that makes your project like the Titanic.
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.
Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Developing a Sharepoint application would have all the fun of a video game, if only you had infinite lives.But that option exists to be used, and some people really do need it.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.You just have to check to see if the vti_sourcecontrolcheckedoutby property on the item was cleared: This code is using the Before Properties and After Properties on the properties parameter to see what the value of the vti_sourcecontrolcheckedoutby property on the item was before the update occurred, and what it will be after the update has completed.What this means is that you cannot store data in instance-level variables and share that data between event handlers.