Itemupdating itemupdated

Developing a Sharepoint application would have all the fun of a video game, if only you had infinite lives.

Dangers lurk hidden out there which, if you run into them, can be a blow to your project and waste a great deal of time.

But here is the article where I read about this when I was experiencing the same issue. Disable event firing in Share Point when updating a list item outside of an event handler Thanks for the answer. The Set Custodian Permissions was also calling update on the item without disabling the event firing.

I removed the update from the Set Custodian Permissions method and it started working as expected.

itemupdating itemupdated-48itemupdating itemupdated-12itemupdating itemupdated-29itemupdating itemupdated-29

I presume this is because the i've called properties. Update(); I do not want the itemupdating event code to run twice. If you put those into a single event receiver, I would expect that it would work the way you want it to. Edit: I cannot seem to find anything about this specifically in any MS documentation.

It turns out that by calling this method at the beginning of your event receiver you can prevent yourself from getting into an infinite loop.

You do want to make sure to call Enable Event Firing when you are done however.

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.


Leave a Reply