Spitemeventreceiver itemupdating example

Rated 3.96/5 based on 572 customer reviews

Next, in our Dispose method, we simply set the value back and you're done.

I have loged the value before an after changing and can see the value change. In this Item Updated event, we are simply assigning the current List Item to a new SPList Item object, changing its "Title" property, and updating it. However, this simple piece of code will cause an endless loop, as each time you call list Item. As you can see, we need a way to prevent this loop from occuring.Luckily there is an easy and elegant solution with a little custom code. List Item Item Adding No value No value Null Item Added No value No value New value Item Updating Original value Changed value Original value Item Updated Original value Changed value Changed value Item Deleting No value No value Original value Item Deleted No value No value Null Also, if you are going to try to compare Before/After values, watch out for these types: People fields, rich text fields (Note), and Date Time fields. = After Value) Library Before Properties After Properties properties.

Leave a Reply