Nick
Nick

Reputation: 41

Get versions when using GetListItem in SharePoint?

Currently I am retrieving list items from a sharepoint list via the provided web services and populate a asp.net web form.

My question is if it's possible to get different versions of a list item (provided they have more than one)?

Thanks in advance.

Upvotes: 1

Views: 1629

Answers (1)

Alexey Shcherbachev
Alexey Shcherbachev

Reputation: 237

Well, as far as i know there is no easy way. But, if you really really need this you could try to do this:

  1. Enumerate all file versions using Versions.GetVersions web service
  2. Get specific version by calling FrontPage RPC method "get document"

The tricky part would be to get the url for a generic list item (for a normal file - it is quite straightforward). I would try something like Lists/Announcements/1_.000 , where Lists/Announcements is the web-relative url of your List, 1 is ListItemId and _.000 is just a constant suffix.

In practice, we used get document method to download a specific version of a document (not a list item). In theory it should work for generic list items too.

Here is also a link with a useful code sample calling "get document" method.

Hope that helps.

Upvotes: 2

Related Questions