I'm having difficulties deleting items from a SharePoint list so I thought I'd post here in case there's something obvious I'm missing. I've been able to succesfully add new items and update existing items using the UpdateListItems web service. And I'm not getting any sort of error message that says the delete failed but the item remains in the list so it's definitely not working.
Here's my CAML:
<?xml version="1.0" encoding="UTF-8"?>
<Batch OnError="Continue">
<Method ID="1" Cmd="Delete">
<Field Name="ID"></Field>
</Method>
</Batch>
And here's the JScript code:
batch = XDocument.DataObjects["TimeActivityDeleteCAML"].DOM;
batch.selectSingleNode("/Batch/Method/Field[@Name='ID']").text = id;
//Update the list
var update = XDocument.DataAdapters["Update"];
try {
var xml = update.Submit();
}catch (err) {
XDocument.UI.Alert("There was an error updating the information: " + err.message);
}
TimeActivityDeleteCAML is my secondary data connection to the CAML mentioned above. Update is my secondary data connection to the UpdateListItems web service. Like I said, it works fine for updates. The only difference between the update and delete is the update CAML contains an entry for the field being updated and the code contains a line to set that value.
Am I missing something obvious? Any help would be appreciated since I've been staring at it blankly for a while now.
I'm using InfoPath 2003 and SharePoint 2007.