Sharepoint UpdateListItems 列表未更新

发布于 2024-08-04 00:03:56 字数 1041 浏览 2 评论 0原文

我向 UpdateListItems 提交更新。它返回成功,但列表项尚未更新。关于如何找出问题所在有什么建议吗?

下面是正在生成的 XML:

<Batch OnError='Continue' ListVersion='1' ViewName=''>
   <Method ID='1' Cmd='Update'>
      <Field Name='ID'>11707</Field>
      <Field Name='Business_x0020_Area'>Consumer</Field>
      <Field Name='Team'>6;#IT Support</Field>
      <Field Name='Job_x0020_Number'>TEMP</Field>
      <Field Name='Media_x0020_Outlet2'>13;#BBC Parliament</Field>
      <Field Name='Publication_x0020_Date'>2009-09-01 14:40:10</Field>
      <Field Name='Narrative2'></Field>
      <Field Name='Page_x0020_Number'>1</Field>
      <Field Name='Media_x0020_Value'></Field>
      <Field Name='Information_x0020_Only'>0</Field>
      <Field Name='Date_x0020_Added'></Field>
   </Method>
</Batch>

更新

我在 U2U 中遇到的错误是

0x81020014 一种或多种字段类型未正确安装。进入列表设置页面删除这些字段。

I submit an update to UpdateListItems. It returns success but the list item ahs not updated. Any advice on how I would track down what is going wrong?

Below is the XML being generated:

<Batch OnError='Continue' ListVersion='1' ViewName=''>
   <Method ID='1' Cmd='Update'>
      <Field Name='ID'>11707</Field>
      <Field Name='Business_x0020_Area'>Consumer</Field>
      <Field Name='Team'>6;#IT Support</Field>
      <Field Name='Job_x0020_Number'>TEMP</Field>
      <Field Name='Media_x0020_Outlet2'>13;#BBC Parliament</Field>
      <Field Name='Publication_x0020_Date'>2009-09-01 14:40:10</Field>
      <Field Name='Narrative2'></Field>
      <Field Name='Page_x0020_Number'>1</Field>
      <Field Name='Media_x0020_Value'></Field>
      <Field Name='Information_x0020_Only'>0</Field>
      <Field Name='Date_x0020_Added'></Field>
   </Method>
</Batch>

Update

The error I am getting in U2U is

0x81020014 One or more field types are not installed properly. Go to the list settings page to delete these fields.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

末骤雨初歇 2024-08-11 00:03:56

我在 CAML 中有一个不在数据库中的内部字段。这导致它绊倒。

I had an internal field in the CAML that was not in the database. This was causing it to trip up.

凌乱心跳 2024-08-11 00:03:56

我的第一个建议是保留字段名称,例如“Business Area”而不是“Business_x0020_Area”。我知道当您查找列表 xml 文件时,字段名称会像这样显示。第二个建议是关于您的日期字段。确保您的日期构建正确。日期字段格式为 YYYY-MM-DDTHH:MM:SSZ。 T 和 Z 很重要。我希望它有帮助。

My first suggestion is keeping field names as they are such as 'Business Area' instead of 'Business_x0020_Area'. I know when when you look up the list xml file, field names are shown like that. The second suggestion is about your date field. Make sure your date is constructed properly. The date field format is YYYY-MM-DDTHH:MM:SSZ. The T and Z are important. I hope it helps.

以可爱出名 2024-08-11 00:03:56

401 表示您尚未登录,或者您登录的用户没有该列表的权限。验证“执行”批处理脚本的用户是否可以登录站点并对列表进行更改。

The 401 is indicating that you are not logged in, or the user who you are logged in as does not have permissions on that list. Verify that the user 'executing' the batch script can log in to the site and make changes to the list.

橘香 2024-08-11 00:03:56

我在日期

public DateTime dateForSp(string s)
{
    string[] sd = s.Split('/');
    string[] yd = sd[2].Split(' ');
    string[] hd = yd[1].Split(':');

    DateTime dt = new DateTime(Int32.Parse(yd[0]),
                               Int32.Parse(sd[0]),
                               Int32.Parse(sd[1]),
                               Int32.Parse(hd[0]),
                               Int32.Parse(hd[1]),
                               Int32.Parse(hd[2]));

    return dt;
}

和代码中做了类似的事情

"<Field Name='SubmissionTime'>" + String.Format("{0:u}", dateForSp(this.rProperty["SubmissionTime"])) + "</Field>" 

I've made something like this for the date

public DateTime dateForSp(string s)
{
    string[] sd = s.Split('/');
    string[] yd = sd[2].Split(' ');
    string[] hd = yd[1].Split(':');

    DateTime dt = new DateTime(Int32.Parse(yd[0]),
                               Int32.Parse(sd[0]),
                               Int32.Parse(sd[1]),
                               Int32.Parse(hd[0]),
                               Int32.Parse(hd[1]),
                               Int32.Parse(hd[2]));

    return dt;
}

and in the code

"<Field Name='SubmissionTime'>" + String.Format("{0:u}", dateForSp(this.rProperty["SubmissionTime"])) + "</Field>" 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文