Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Does anyone know how to programmatically determine if any non-system fields have changed between ListItem versions? I realize that I could iterate through the fields between each version and if I see a change occurs (then keep the version otherwise delete it), but this seems very expensive to do.

When you click on version history for a listitem, you get a nice summary of changes between versions. Is this code/SQL accessible to the developer?

share|improve this question
add comment

2 Answers

If you take closer look at versions.aspx (\14\TEMPLATE\LAYOUTS) you will notice that 'nice summary' is created by iterating over item versions (from line 311 to 357).

My guess is if versions.aspx uses iteration to retrieve field changes then this is the only option available.

Edited: To be completely correct: It is not the only option. You can probably execute query directly on content database but here you have nice explanation why you really don't want to do this:

http://stackoverflow.com/questions/1665755/how-to-query-on-sharepoint-database

share|improve this answer
add comment

Not sure this will solve your problem completely, but may help a bit. To see the SQL being executed, you could enable and use the developer dashboard.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.