Event receiver itemupdating beforeproperties
Using event receivers in Share Point Development is such a cool feature. It possible to call by code ther after and before properties.Like it is called it’s an piece of code which can be executed by a certain event. But which value those have is told in this post and this post.This event occurs before the data is saved to the Share Point list.To check if the name of the planet is changed, you can compare the Title column before the changes with the Title of the changed item.So I'm trying to accomplish this kind of functionality on my Share Point 2010 list: I have a field of type choice in my list, which has 7 values and i want users not to be able to change the value of that field from values 2,3,4,5,6,7 to value 1.I've written an event receiver for that list, here's my code: Use Item Updating event and then afterproperties contains changed value and List Item contains original value of a field.
Before you can deploy the event receiver you have to change the file to bind the Update Adding event receiver to all custom lists.Following Table will give you a clear picture about the contextual data in each events.Within an event receiver, you have two hash tables available to you within SPItem Event Properties, Before Properties, and After Properties.Remember that if you want to develop event receivers for specific lists, you will have to work with content types.I’m Karine Bosch and currently I’m working as Share Point Solution Architect for Recomatics, a company located in Destelbergen near Ghent.