This was my scenario: I had created a remote event receiver that was attached to a document library and was supposed to act whenever an item in the list was updated.
The problem was that I had written an Event Receiver to handle Item Added events for a custom list.
The handler simply creates a task in the Tasks list corresponding to the new item added to the custom list.
I’m Karine Bosch and currently I’m working as Share Point Solution Architect for Recomatics, a company located in Destelbergen near Ghent.
Previously I worked as a Premier Field Engineer for Share Point @ Microsoft Belgium.
Before you can deploy the event receiver you have to change the file to bind the Update Adding event receiver to all custom lists.
Remember that if you want to develop event receivers for specific lists, you will have to work with content types.You could think that the current values are stored in the Before Properties of the item but that’s not true: the Before Properties are unreliable at this point. When the name of the planet is changed, the update is canceled and an error message is returned to the user.If the name isn’t changed, the changes are saved to the Share Point list.I had already covered all the basic things such as: I even went as far as completely emptying the body of the handler to see that in fact the event was firing twice.As with any problem, I always try to resolve it through the process of elimination by first isolating the core issue into a test project and therefore out of the primary project I’m experiencing it in because sometimes you can’t see the forest because of the trees. After creating the simple project, the problem was still there. The event wasn’t firing twice for the same list, it was firing for ALL Lists. I took another look at my event receiver I had added via Visual Studio to the project. Yes, I had left the file for the Event Receiver there, and therefore when the feature was activated for the project, the receiver got associated to ALL lists on the site.For example when a user adds a document to a document library first event triggers is Item Added when document is added to list, whereas second event occurs when user is forwarded to /Forms/Edit Form.aspx? You can prevent it by checking if added item is changed after being added to library/list or not using SPItem Event Properties.