Sometimes that is the most exciting way to learn, but for those less adventurous I will briefly cover the topic here.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).
Itemupdating vs itemupdated
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.
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.
I removed the update from the Set Custodian Permissions method and it started working as expected.
event when an Update button (a button with its Command Name property set to "Update") within the control is clicked, but after the Form View control updates the record.
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.
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 have a custom list (not document library) that i have attached 2 event receivers to. My itemupdating event receiver sets a value in a field and my itemupdated sets some permissions on the item.
I've noticed that the after the itemupdated method is called the itemupdating method is called again. The reason it's done this way is that this could cause code from 3rd parties or other developers to function unexpectedly.
Hopefully you know about item event receiver if you are having problems with them firing twice.