One of the things I found out the hard way while programming event handlers in sharepoint is that you have to wrap your update() or delete() functions with the disableeventfiring function individually, for example:
this will work:
base.DisableEventFiring();
item.update();
base.EnableEventFiring();
this will NOT work:
base.DisableEventFiring();
item.update();
item.delete();
base.EnableEventFiring();
So the moral of the story is, only do one event triggering action at a time, do not try to do 2 or more within one wrapper.




Hi there.
This is off course a great and good summary of what to do when eventFiring kicks in. Allthough I would like to know how to get it disabled when in a Forms application.
I need to disable the eventhandler that is called when an SPListItem is deleted. And I can’t seem to this.disableEventFiring(). So how do I get the base-object you made there (what type it is). I do have SPSite, SPWeb and all sorts of objects at my disposal, is there any way to extract this base-object you made there (probably the SPItemEventReceiver). Seems like I’m unable to find what I should use to obtain it succesfully.
this is only 2007 version, what about 2010?
http://blogs.msdn.com/mjsabby/archive/2010/01/24/disabling-events-in-sharepoint-2007-and-sharepoint-2010.aspx