Sharepoint 2016 itemupdating afterproperties
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.
For example, if you define an instance level variable in the class to store data in the Item Updating event, then try to access that data in the Item Updated event, you will find that the data is not there when you go to check it in the Item Updated event.
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.
When accessing a user field in event receivers there are few differences in the returned values when Classic mode authentication is used from the value when Claims based authentication is used.
The difference is present in After Properties of Item Adding and Item Updating event.
Developing a Sharepoint application would have all the fun of a video game, if only you had infinite lives.
Dangers lurk hidden out there which, if you run into them, can be a blow to your project and waste a great deal of time.