【问题标题】:Batch Update (Error Code 0x81020016)批量更新(错误代码 0x81020016)
【发布时间】:2012-09-30 21:06:57
【问题描述】:

我已使用网络服务来更新 Sharepoint 列表。我正在使用网络凭据访问 remort 服务器。

mylist.Credentials = new NetworkCredential(_username, _password, _domain);

这是我的 innerXml 代码:

       StringBuilder innerXml = new StringBuilder();
              innerXml.AppendFormat("<Method ID='1' Cmd='Update'>" +
              "<Field Name='ID'>" + id + "</Field>" +
              "<Field Name='Title'>" + title + "</Field>" +
              "<Field Name='CostCTRShortText'>" + CostCTRShortText + "</Field>" +
              "<Field Name='ActTyp'>" + ActTyp + "</Field>" +
              "<Field Name='Employee'>" + Employee + "</Field>" +
              "<Field Name='Price'>" + Price + "</Field>" +
              "<Field Name='ITECCategory'>" + ITECCategory + "</Field>" +
              "<Field Name='ServicePrice'>" + ServicePrice + "</Field>"
              );

        innerXml.AppendLine("</Method>");

不幸的是,我在更新时遇到错误:

<Result ID="1,Update" xmlns="http://schemas.microsoft.com/sharepoint/soap/"><ErrorCode>0x81020016</ErrorCode><ErrorText>Item does not exist

The page you selected contains an item that does not exist.  It may have been deleted by another user.</ErrorText></Result>

这仅在我尝试更新远程服务器中的列表项时发生。相同的代码将按预期工作并更新本地站点中的列表项。

请帮帮我。

【问题讨论】:

  • 错误消息告诉您您正在尝试更新不存在的列表项。您是否仔细检查过您引用的 ID 确实存在于远程服务器的列表中?

标签: web-services sharepoint-2007 sharepoint-list innerxml


【解决方案1】:

我找到了问题。这里ID 正在发挥重要作用。确保您的 ID 字段检索到正确的值。就我而言,我的本地列表从 ID =1 开始,但生产服务器列表没有 ID=1 的行。

您可以简单地从您的 SharePoint 列表中看到此 ID 列。并检查值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-13
    • 1970-01-01
    • 2014-12-13
    • 2016-06-04
    • 2016-02-03
    相关资源
    最近更新 更多