Getting Version Changes From SharePoint

SharePoint doesn’t provide a straightforward way to do this it seems.  My first crack was to try to leverage the BeforeProperties and AfterProperties in an event receiver, but it turns out that this doesn’t work quite as you would expect based on the naming of these two properties (and the same goes for ChangedProperties).

However, clearly we can see that the version history contains the changes in the fields from one version to the next.

Here’s some basic code to identify the fields that changed from one version to the next:

This will get you the changes between the current version and the previous version.  If it’s a new object, all of the changes will be returned.

You may also like...