Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Is it possible to use a variable to store the value pairs for a SPServices.UpdateListItems call?

$
0
0
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:
<?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

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>