Sharepoint 2016 itemupdating afterproperties Just hook up

19-Oct-2016 22:22

I tried other fields, and they got written to the item just fine.After some trial-and-error and consulting the MSDN I found a solution.One small difference between Share Point 2010 and Share Point 2013 is that in Share Point 2010 even if the user field is not changed the After Properties in Item Updating event will have the value “-1;#i:0#.w|domain\user1”.In Share Point 2013 if the field is not changed then the After Properties in Item Updating event contain the user ID.For testing I created a custom list that contains one User field, added the event receiver and overrode all the list item event handlers. The test is repeated when using Classic authentication and when using Claims based authentication.For every event I tried to get the value of the user field from properties. Also the test is repeated for Share Point 2010 and Share Point 2013.An Item Event Receiver, which is executed synchronously to prevent save conflict exception or problems with published items, was supposed to do exactly that.

sharepoint 2016 itemupdating afterproperties-63sharepoint 2016 itemupdating afterproperties-73sharepoint 2016 itemupdating afterproperties-42

For reference below are all the results from the tests for Share Point 2013 for Claims based authentication and Classic authentication, both when working with a list item using the UI and programmatically.In the tests user1 and user2 are used and they happen to have ID of 41 and 42.When adding, modifying and deleting item using the UI: You can see that the problem is only with claims based authentication while with classic authentication the results are the same when the item is added/modified using the UI and when it’s added/modified programmatically.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.

For reference below are all the results from the tests for Share Point 2013 for Claims based authentication and Classic authentication, both when working with a list item using the UI and programmatically.

In the tests user1 and user2 are used and they happen to have ID of 41 and 42.

When adding, modifying and deleting item using the UI: You can see that the problem is only with claims based authentication while with classic authentication the results are the same when the item is added/modified using the UI and when it’s added/modified programmatically.

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.

This is true for Share Point 2010 and Share Point 2013 and its present only for custom lists but not for document libraries.