开发者

Using SharePoint's lists.asmx and UpdateListItems to delete an item by Guid or UniqueId

开发者 https://www.devze.com 2023-01-24 04:48 出处:网络
I am trying to call the lists.asmx UpdateListItems() to delete a list item by unique id or guid.The following batch xml fails with \"Invalid URL Parameter. The URL provided contains an invalid Command

I am trying to call the lists.asmx UpdateListItems() to delete a list item by unique id or guid. The following batch xml fails with "Invalid URL Parameter. The URL provided contains an invalid Command or Value. Please check the URL again".

<Batch OnError="Continue" ListVersion="1" ViewName="">
  <Method ID="1" Cmd="Delete">
    <Field Name="Guid">7be4a863ce-08de-4506-9c69-400749860e76</Field>
  </Method>
</Batch>

In addition, I have tried with and without enclosing "{}", UrlEncoding, using U开发者_JAVA技巧niqueId instead of Guid, prefixing the guid with "[id];#", etc. but to no avail.

Using the ID will work, but I would prefer using the Guid if possible:

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

Anyone have any ideas, or is this not possible using the UniqueID or Guid?


From the documentation, they only give an example using ID... which leads me to believe it probably will not work with anything else.

0

精彩评论

暂无评论...
验证码 换一张
取 消