SPServices UpdateListItems not actually updating items

Jan 13, 2012 at 4:59 PM

Hi all,

I am running into a unique issue at the moment. I am building a very simple SPServices UpdateListItems statement to update one field of a selected SP item from a drop down list. The logic simply goes off and updates a text field with a value in a textbox.

SharePoint Items: <DROPDOWNLLIST>

New Value: <TEXTBOX>

| Update Button |

My UpdateListItems syntax is as follows:

var batchCaml = "<Batch OnError='Continue'>";
batchCaml += "<Method ID='1' Cmd='Update'>";		// 1 record affected
batchCaml += "<Field Name='ID'>" + selectedDocumentId + "</Field>";		// Set the ID field of the selected item
batchCaml += "<Field Name='DocumentDescription'>" + newValueFromTextBox + "</Field>";
batchCaml += "</Method>";
batchCaml += "</Batch>";

				operation: "UpdateListItems",
				async: false,
				listName: "Drafts",
				updates: batchCaml,
				completefunc: function (xData, Status) 
					// window.location.reload(true);
					var out = $().SPServices.SPDebugXMLHttpResult
					({	node: xData.responseXML,
						outputId: divId
					$(divId).html("").append("<b>This is the output from the UpdateListItems operation:</b>" + out);
					$(divId).append("<b>Refresh to see the change in the list above.</b>");


After running the UpdateListItems syntax, the debug information shows the following below. No error code is returned and the XXXXX is the value entered from the textbox...all appears to have worked. The issue is that upon returning the actual SPList and refreshing the view, the field still has the old value (it wasn't actually updated to XXXXXX, even though the SPServices call appears to have worked).  Any ideas?

xml version="1.0" encoding="utf-8" 
0 version 1.0 
1 encoding utf-8 
0 xmlns:soap http://schemas.xmlsoap.org/soap/envelope/ 
1 xmlns:xsi http://www.w3.org/2001/XMLSchema-instance 
2 xmlns:xsd http://www.w3.org/2001/XMLSchema 
0 xmlns http://schemas.microsoft.com/sharepoint/soap/ 
0 ID 1,Update 
ErrorCode 0x00000000 
0 ows_ContentTypeId 0x0101007B9487E9C4334930A393D9E96E152D360200EFDCF698F39EB74FB4B8B7E58DE4039C 
1 ows_FileLeafRef 32;#MyTestLink.pdf 
2 ows_Modified_x0020_By SHAREPOINT\system 
3 ows_Created_x0020_By SHAREPOINT\system 
4 ows_File_x0020_Type pdf 
5 ows_DocumentDescription XXXXXX 

Jan 13, 2012 at 7:11 PM

Is it possible that you have major/minor versioning on? Depending on the permissions, you might be seeing the old value in the previous version.