BreakHead
BreakHead

Reputation: 10672

Delete Document from SharePoint Document list, using Lists.asmx, just by ID

I am looking for a solution to just a pass a Item Id to delete the documents, without passing FileRef parameter.

will appreciate any help?

Thanx

Upvotes: 0

Views: 1808

Answers (1)

Mark Mascolino
Mark Mascolino

Reputation: 2292

UpdateListItems will do what you want:
http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems(v=office.12).aspx
For the xml block you will want something like this to delete item id=1234:

<Batch OnError="Continue" ListVersion="1" >
<Method ID="1" Cmd="Delete">
  <Field Name="ID">1234<Field>
</Method>
</Batch>

Upvotes: 2

Related Questions