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

SPUpdateMultipleListItems not deleting

Oct 6, 2015 at 2:36 PM
I have a button which runs script to delete all items in a list. When I look at what is happening using Fiddler, I can see the expected GetListItemsResult soap envelope showing 1902 rows corresponding to the 1902 items currently in the list. However, the soap envelope for UpdateListItems doesn't contain the items to be deleted. The script runs without error (Fiddler shows 200 for GetListItems and UpdateListItems) but no items are deleted. I have also tried with the script containing a CAMLQuery parameter with the same result. Below is the script and any help is appreciated.

<script type="text/javascript" src="/corp/GovernanceRiskComplianceCoE/Site Assets/jquery.SPServices-2014.01.js"></script>
<script language="javascript" type="text/javascript"> $(document).ready(function(){ $('#MyButton').click(function(){ DeleteAll(); }); }); function DeleteAll() { $().SPServices.SPUpdateMultipleListItems({ listName: "Access Details", batchCmd: "Delete" }); } </script> <input type="button" value="Delete Template Items" id="MyButton" >
Oct 15, 2015 at 8:28 PM
That's probably too many items for the function to process in one call. I've not tried to make the function bulletproof - it works fine for a relatively reasonable n (maybe in the low hundreds) but I wouldn't expect it to work with that many items.

You could clone the function and alter it to loop through and delete maybe 50 items at a time and it should work.