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

SPUpdateMultipleListItems not deleting all list items

Apr 29, 2011 at 2:27 AM
Edited Apr 29, 2011 at 2: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>"; 
listName: "COPE",
CAMLQuery: cmlQuery,
batchCmd: "Delete"});

Many Thanks!
Apr 29, 2011 at 2:31 AM


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


Apr 29, 2011 at 2: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.

Apr 29, 2011 at 4:34 AM
Edited Apr 29, 2011 at 4: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.