Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: SPUpdateMultipleListItems not using defaults.listName?

I'm using default to specify a list name to use on all of the calls on this page:
$.SPServices.defaults.listName = "MyList";
On this page I use these functions which should use this default:
  • $().SPServices() - operation: "GetList"
  • $().SPServices.SPUpdateMultipleListItems
  • $().SPServices() - operation: "UpdateListItems"
The call to SPUpdateMultipleListItems keeps on failing, both other calls work with the now defined defaults value.
Reason being that the call to $().SPServices() - operation: "GetListItems" within SPUpdateMultipleListItems fails because the list name default doesn't seem to be used (see line 3448 in jquery.SPServices-2014.01.js).

This is the relevant quote from the request that's being sent bei GetListItems to Lists.asmx: "<listName></listName>"
Once I define the " listName: 'MyList' " in my call to SPUpdateMultipleListItems manually again the same quote is: "<listName>MyList</listName>"

I tried to debug this but my JS skills aren't enough to the bottom of this.
Does SPUpdateMultipleListItems not use the defaults value or could there be some other error?

TL;DR

-- WORKS --
jk().SPServices.SPUpdateMultipleListItems({
  listName: "MyList",
  async: false,
  CAMLQuery: "<Query><Where><Gt><FieldRef Name='ID'/><Value Type='Integer'>0</Value></Gt></Where></Query>",
  batchCmd: "Delete",
  completefunc: function(xData, Status) {
    doStuff();
  }
}); 
-- DOES NOT WORK --
jk().SPServices.defaults.listName = "MyList";

jk().SPServices.SPUpdateMultipleListItems({
  async: false,
  CAMLQuery: "<Query><Where><Gt><FieldRef Name='ID'/><Value Type='Integer'>0</Value></Gt></Where></Query>",
  batchCmd: "Delete",
  completefunc: function(xData, Status) {
    doStuff();
  }
}); 

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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