5

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?

2 Answers 2

4

You 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

1

On Item added, before item.update() disable event firing, this.EventFiringEnabled =true; will do

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.