When adding a new document, both Add and Update events trigger my event receivers. I have an Add and an Update event receiver.
Is there a way to avoid the Update event?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityYou can't actually stop the Updated event from firing. There's a full lifecycle of events that will always run, so the trick is to check for certain conditions within a given event to determine whether or not you want your code to run at that time. This blog does a good job of walking through the events, and why they fire. Ultimately you can look at a combination of before and after properties to determine whether your code should run, similar to an example on the above blog that looks for certain metadata to determine whether the event is tied to a user just checking a document in.
Cheers, Matt
On Item added, before item.update() disable event firing, this.EventFiringEnabled =true; will do