Fired event itemupdating which diplomy online dating
I could have just removed the elements file reference from the feature, but just chose to delete the elements file in its entirety. So folks, when you create an event receiver via the Share Point tools in Visual Studio, and you REALLY don’t want it associated to every single list, remember not to be a bone head like me.Normally what happens is developer's use both Item Added and Item Updated events when they want to execute some specific code across just added list item, in result multiple list events triggers.Every time an item was added to the custom list, the event was firing twice.I was associating the event receiver to the custom list through Feature Activated on a feature receiver for my Event Receivers project.In my case I was changing the value of a custom property named CMIs Secret, so if that property was the same in before Properties as in after Properties (the values before and after the save) I should go on with the update, otherwise not.This was the method I created: It checks if the property exists at all (it doesn’t if it is an Item Added-event and the property is custom made) and if it differs.The event receiver was nicely attached and got busy when I uploaded a document. I was trying to change permissions on an item and this was the part of my code that was creating the problems: Inside my SPRemote Event Type.
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.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.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.
Even a simple app to enumerate the event receivers associated to the list only showed the one instance. Well, I had moved on to other things again, when all of a sudden, I noticed that new tasks were being created in the task list for some documents that I was uploading to a different document library. That’s pretty much the symptom for a receiver associated to a list template, but this was NOT a list template! It wasn’t going to show up in the Event Receivers collection for that list instance, because it was associated to the list type.