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

May I know how can one use SPServices to retrieve all the version history of a particular items in a SharePoint 2007 Server List? (If it is not possible via SPServices, are there other Javascript plugins similar to SPServices, that can retrieve all the version history?)

UPDATE 1:

$().SPServices({
  debug: true,
  operation: "GetVersions",
  async: false,
  listName: "System1",
  completefunc: function (xData, Status) {
    $(xData.responseXML).find("[nodeName='z:\\row']").each(function() {
        alert($(this).attr("ows_ID"));
    });
  }
});
share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

I believe that you are looking for this:

$().SPServices({
  operation: "GetVersionCollection",
  async: false,
  strlistID: "tester",
  strlistItemID: 1,
  strFieldName: "Information",
  completefunc: function (xData, Status) {
    $(xData.responseText).find("Version").each(function(i) {
      console.log("Name: " + $(this).attr("Information") + " Modified: " + $(this).attr("Modified"));
    });  
  }
});

Just replace the word "tester" with the name of your List. Also replace the word "Information" with the name of your column (header).

Further details can be found in here - http://spservices.codeplex.com/discussions/284298

share|improve this answer
add comment

You should be able to get all of the versions of an item by calling the Versions Web Service with SPServices.

share|improve this answer
    
Hi Marc, do you have a sample code of SPServices retrieve a version history of a item in a SharePoint List 2007? –  Anderson Karu Nov 18 '11 at 7:38
    
There are plenty of examples on the SPServices site that show how to use the Web Services and process the results. –  Marc D Anderson Nov 19 '11 at 14:35
    
Hi Marc, I tried and added the code inside my question under 'Update 1' but could not get the web site to display the version history of my items in my SharePoint List called - System1. Any insight? –  Anderson Karu Nov 21 '11 at 9:14
    
You're not looking for the right node. If you look at the SDK for that operation (link above), you'll see that the result isn't z:rows, but results. –  Marc D Anderson Nov 23 '11 at 23:27
1  
Thanks Marc, I think your GetVersionCollection written by you and discussed with LarryMorries (spservices.codeplex.com/discussions/284298) is the one that I find useful and quite close (even though I have to specific which ID of the rows I want to retrieve the version history) –  Anderson Karu Jan 5 '12 at 8:45
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.