SPUpdateMultipleListItems not deleting all list items

Coordinator
Apr 29, 2011 at 1:27 AM
Edited Apr 29, 2011 at 1:28 AM
From joe_dsi, originally as this issue in the Issue Tracker.
 
Hi Marc,

Im currently using SPUpdateMultipleListItems in one of my Delete All Response buttons. Once user clicks on the button, all items with the same linkID should be deleted. For some reason, only one record gets deleted. Ive already set debug to true but it did not pop any exception. Please see code below. please help

var cmlQuery = "<Query><Where><Eq><FieldRef Name='LinkID'/><Value Type='Integer'>"+linkID+"</Value></Eq></Where></Query>"; 
$().SPServices.SPUpdateMultipleListItems({
listName: "COPE",
CAMLQuery: cmlQuery,
batchCmd: "Delete"});

Many Thanks!
Coordinator
Apr 29, 2011 at 1:31 AM

Joe:

Your code seems good. Are you sure that you have multiple items with exactly the same LinkID in the COPE list?

M.

Apr 29, 2011 at 1:36 AM

yes im pretty sure they have the same LinkID. after saving ive double checked the ID. I tried to add a 2 sec delay after calling SpUpdateMultipleListItems, then called it one more time just for testing, it did delete the other items. Does the size of the list matter? column wise.

Coordinator
Apr 29, 2011 at 3:34 AM
Edited Apr 29, 2011 at 3:35 AM

If the function is doing what you'd expect after a two second delay, then is it possible that the items don't yet exist when it runs the first time? Items are created asynchronously.

M.