在sharepoint中更新列表时,UpdateListItems给出错误

本文关键字:UpdateListItems 出错 错误 sharepoint 更新 列表 | 更新日期: 2023-09-27 18:16:07

我正在尝试使用sharepoint列表web服务更新列表。但是我得到以下错误

Results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
 <Result ID="1,Update">
  <ErrorCode>0x8102000a</ErrorCode> 
  <ErrorText>Invalid URL Parameter. The URL provided contains an invalid Command or Value. Please check the URL again.</ErrorText> 
  </Result>
  </Results>
这是我的代码片段
string strViewID = "{46FCE9EB-C789-430F-B1A3-9ACA41FE9BD9}";
            XmlDocument camlDocument = new XmlDocument();
            XmlNode queryNode = camlDocument.CreateElement("Query");
            XmlDocument myListDoc = new XmlDocument();
            XmlElement batchXML = myListDoc.CreateElement("Batch");
            batchXML.SetAttribute("OnError", "Continue");
            batchXML.SetAttribute("ListVersion", "1");
            batchXML.SetAttribute("ViewName", strViewID);
           batchXML.InnerXml = "<Method ID ='1' Cmd='Update'>" + "<Field Name='Title'>Z</Field>" +"<Field Name='Region'>West</Field>"+
               "<Field Name='Size'>Z</Field>" + "<Field Name='Sales'>Z</Field></Method>";    
              XElement sys = XmlElementToXelement(batchXML);
                XElement myListReturn = ws.UpdateListItems("{A30AFD47-7118-4904-A3B9-BCEFF7E3E203}", sys);

请帮助。

在sharepoint中更新列表时,UpdateListItems给出错误

您可能想尝试在Update中添加ID列和其他列,然后再试一次-

& lt;字段Name='ID'>要更新的字段ID