Itemupdating before properties afterproperties

Generally a problem I would expect from an asynchronous handler.To solve this, I do the heavy lifting code in Item Adding, and then simply do a resetting of the value in Item Added to ensure that it sticks.

itemupdating before properties afterproperties-26

By comparing the values in the before Properties with the after Properties I could see if they contained a difference.

If it doesn’t, the updating event should not happen again.

How I solved it Googleing this helped me not one bit and my first solution was something I would like to hide at the bottom of some server (I don’t want to talk about it, let’s just say it had something to do with counting the seconds since the last update).

At your disposal on SPRemote Event Properties you have after Properties and before Properties, found by doing this: And those were the key to the problem: how to act on the firing only when the user changes something and not when it updates itself?

So, it appears it is not the only trick up their sleeve…

If you ever tried getting the title or name columns in a document library you will quickly notice After Properties and Before Properties will always return null. forum=sharepointdevelopmentprevious And at the very bottom, there is an answer by Helm Ifort that I found very interesting.

It appears the title column value is available in After Properties, only you have to use the “vti_title” name for it! ) In my book, this is a bug, and an undocumented one at the very least…

I hope someone fixes it soon, but for now it is one of those things seasoned Share Point sharks need to remember.

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.

Item Updated I did an Update and making it trigger itself. If you’re dealing with a event receiver with access to server side code, this is not a problem.

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.