I have got SPServices.UpdateListItems to work when explicitly setting the value pairs parameter in the function call, but when I try to set the value pairs as a variable and reference that variable in the same function call I get an error as follows:
Thanks
Simon
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Cannot access a closed Stream.</errorstring></detail></soap:Fault></soap:Body></soap:Envelope>
I am setting my variable as follows:$valuePairStr = '[["JobTitleLookUp",$jobTitleLookUp.val()],["Description_x0020_of_x0020_Dutie", $descDuties.val()],["Pay_x0020_Basis", $payBasis.val()],["Contracted_x0020_Hours",$contHours.val()],["Advertisement_x0020_Date",$adDateformatted],["Application_x0020_Close_x0020_Da",$appCloseDateformatted]],'
...and my SPServices call is as follows:$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "Update",
listName: "Manage Recruitment Process Tasks",
ID: $myID,
valuepairs: $valuePairStr,
completefunc: function(xData, Status) {
alert(xData.responseText + Status);
if (Status === "success"){
alert("Your updates have been saved");
dispCustomButton($btnPlaceJobAd);
}else{
alert("Your updates could not be saved. Please check and retry");
showCustomButton(false);
}
}
})
Have I goofed somewhere, or am I not able to use a variable string in lieu of the value pairs paremeter?Thanks
Simon