5

Using server-side code I can access List Item version history using SPListItem.Versions.

Is there a way to programmatically access the same information from the client?

I am happy to use either the Client Object Model, SharePoint Web Services or any other mechanism.

Note:

  1. I am trying to access this information remotely - please don't answer with server-side code.
  2. I am not trying to access FileVersionHistory - I'm after history for the ListItem itself.
  3. Custom web service is not an option.
1
  • i wanna ask you about this topic, can i use method as GetVersionCollection() to get field that changed and in which version this field changed. GetVersionCollection() return value of data changed between versions for specified field, but how can i get the value changed with the number of version to this field. Thanks.
    – leen
    Commented Mar 21, 2012 at 8:52

1 Answer 1

7

Take a look at my answer provided to very similar question:

Get meta data from a previous version of a document through webservice in MOSS 2007

Using web service and Lists.GetVersionCollection Method is (as far as I know) only available option. So you need to call it for each field of your item.

Client object model is not an option.

UPDATED

To get all versions of version field you just need to call GetVersionCollection method on version field by passing it's internal name _UIVersionString

Simple code snippet:

ListProxy.Lists lists = new Lists();
lists.UseDefaultCredentials = true;
XmlNode versions = lists.GetVersionCollection("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}", 
                                                       "n", "_UIVersionString");
foreach(XmlNode version in versions.ChildNodes)
{
    Console.WriteLine(version.Attributes["_UIVersionString"].Value);
}
3
  • @GregSansom: It provides. Take a look at my updated answer. Commented Jan 21, 2012 at 22:56
  • That is your choice and it really depends on your specific application needs. I would not be comfortable with HTML parsing like you suggested. Anyway it is strange that better alternative doesn't exist. Commented Jan 23, 2012 at 8:31
  • I was breaking my head all day to find a solution through COM. It is surprising to know that MSFT has not provided that option using COM. You dead straight answer helped me to save further time I was about to waste in this.
    – NLV
    Commented Oct 16, 2013 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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