This project has moved and is read-only. For the latest updates, please go here.

SPUpdateMultipleListItems completefunc

Sep 20, 2011 at 2:56 PM

I posted this comment at but have not had any feedback so thought I would try it here and add more details.

I am trying to use SPUpdateMultipleListItems (using SPServices-0.6.1.min.js).  While it is doing what I need it to do as far as updating the list, I am trying to use completefunc with values xData and Status like in other SP services, but I keep getting back that xData and Status are undefined. I would like to get the values back for error handling because I need to know for sure that the updates were a success.  The code I'm using is:

updatePMs: function (projectId, itemsArray) {
   var success = true;
        operation: "UpdateListItems",
        async: false,
        CAMLQuery: '<Where><Eq><FieldRef Name="Project" LookupId="True" /><Value Type="Lookup">' + projectId + '</Value></Eq></Where>',
        listName: "ContractActions",
        valuepairs: itemsArray,
        completefunc: function (xData, Status) {
       // check for errors
           var soapResponse = soapResponseData.getErrorResponse(xData, Status);
               if (soapResponse.responseData.IsError) {
              errorLogData.addError("updatePMs Failed", "updatePMs in contractActions.js", soapResponse.responseData.Details);
             success = false;
     return success;

The getErrorResponse and addError calls are to routines I've defined elsewhere. But I can't use them because I am not getting back values for xData and Status. Any suggestions are appreciated.

Sep 21, 2011 at 2:31 PM

Sorry I haven't replied, jindihar.

It's on my list to fix that issue with the completefunc in SPUpdateMultipleListItems. In the meantime, you might consider cloning the function to enhance it for yourself.