How to update a sharepoint list item via web services using a where clause?
Posted
by JL
on Stack Overflow
See other posts from Stack Overflow
or by JL
Published on 2010-06-02T18:25:15Z
Indexed on
2010/06/02
18:34 UTC
Read the original article
Hit count: 252
I would like to update a list item using SharePoint and am stuggling to find 1 decent CAML example.
Here is what I want to do, in SQL my query would look something like this
update [table] set field='value' where fieldID = id;
so this would mean I have 1 item in a list I would like to update 1 field on given the ID of that listitem.
I've tried this, but it doesn't work:
batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" +
"<Field Name='DeliveryStatus'>" + newStatus.ToString() + "</Field>" +
"<Where><Eq><FieldRef Name='ID' /><Value Type='Text'>" + id + "</Value></Eq></Where></Method>";
© Stack Overflow or respective owner