[SPServices 2014.01.min, jQuery 1.10.2.min]
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();
}
});
```
Comments: Two remarks to clarify my code above: 1. My first code quote to demonstrate how I specified the default list name actually said what it says in the "DOES NOT WORK" section below - as in: I used "$()." and not "$." 2. In the "WORKS" and "DOES NOT WORK" sections you should read "jk()" as "$()" - I just use a different name than the default.
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();
}
});
```
Comments: Two remarks to clarify my code above: 1. My first code quote to demonstrate how I specified the default list name actually said what it says in the "DOES NOT WORK" section below - as in: I used "$()." and not "$." 2. In the "WORKS" and "DOES NOT WORK" sections you should read "jk()" as "$()" - I just use a different name than the default.