One of the problems I had with list event handlers was event recursion. I wrote an event handler to handle updating items. I wanted to check some values, and then set a value in a field based on a set of rules. The problem was- when I set the value of the field and updated the item, the ItemUpdated and ItemUpdating events fired up again, and again my code updated the item and so on and so on. I also wanted to avoid having the list item change version number following my code-update. that update was supposed to be part of the version that the user just created by updating. Otherwise, every user update of the list item would bump the version number twice! Similarly, I didn't want the code to show that an administrator changed the item. I wanted it to look as if the user did the change to that field. So after some research, here is my solution: item[fieldnamehere] = fieldvaluehere; this.DisableEventFiriing(); item.SystemUpdate(false); this.EnableEventFiring(); ...
SharePoint Excellence is a community for Microsoft 365 professionals.