Search code examples
c#sharepointwindows-sharepoint-serviceswss-3.0sharepoint-api

Update Version History Programmatically


In my webpart I need to populate the data from the sharepoint lists and libraries.

I have an option to change the data in the UI and that should reflect the same in the lists/libraries when i click on save button.

Problem is even if I am not changing the data and click on save the new versions are adding in my version history with out any changes..

This brings lot of problems in the audit. I need solution/code that it should update the version history only if the item(list row) is changed when we click on save button.


Solution

  • You need to put this logic in the code itself. Before overwriting the list item, compare the list item with the previous version and if its same, do not overwrite.