Spitemeventreceiver itemupdating example Free text to fuck

21-Aug-2016 09:13

How can we prevent a user from changing a certain column for an item in a list event?

From the list table, you can see if we hook into the Item Updating event, we can compare the current item’s value (properties.

(like all those events that are having “-ed” as suffix). Error Message = "This column cannot be changed"; } } But such examples are only valid for Document Library in context, as per the Microsoft; as it is written in SDK that “For documents, Before and After properties are guaranteed for post events, such as Item Updated, but Before properties are not available for post events on list items”.

As far as After Properties and Before Properties are concerned for any event, they can help you to extract After and Before change in state about the object in context. So, statement written like these form the basis of analysis, on testing various events during Addition, Deletion and Update of both Share Point lists and Share Point library, here is the conclusion that is actually drawn for any List: No value means that column value in the hash table was not available.

spitemeventreceiver itemupdating example-73spitemeventreceiver itemupdating example-86

Original value means that the correct original value was available.

So, if we go back to our original problem listed above.

There are two type of Share Point events: Asynchronous (After) and Synchronous (Along) events. are: Item Adding, Field Updating, Feature Deactivating etc…

(like all those events that are having “-ing” as suffix). are: Item Added, Field Updated, Feature Activated etc…

This case is true and valid for any document library in context. New value means that the correct value for the column was available. Error Message = "This column cannot be changed"; } Hope this analysis provide you quite a clear picture about After/Before Properties on any Document Library and List.

Original value means that the correct original value was available.

So, if we go back to our original problem listed above.

There are two type of Share Point events: Asynchronous (After) and Synchronous (Along) events. are: Item Adding, Field Updating, Feature Deactivating etc…

(like all those events that are having “-ing” as suffix). are: Item Added, Field Updated, Feature Activated etc…

This case is true and valid for any document library in context. New value means that the correct value for the column was available. Error Message = "This column cannot be changed"; } Hope this analysis provide you quite a clear picture about After/Before Properties on any Document Library and List.

For example, if you want to prevent any change in particular column of Document library your code must be: public override void Item Updating(SPItem Event Properties properties) { if (properties. Changed value means that the correct updated value was available.