0x81020014一个或多个字段类型未正确安装。进入列表设置页面删除这些字段
在共享点中,当尝试更新列表时,我收到错误:
0x81020014One or more field types are not installed properly. Go to the list settings page to delete these fields.
正在创建的 Caml 是:
<Batch PreCalc='TRUE' OnError='Continue'>
<Method ID='1' Cmd='Update'>
<Field Name='ID'>4</Field>
<Field Name='Flagged'>False</Field>
</Method>
</Batch>
当我从 U2U 运行 Caml 时,它工作正常并且字段更新。当我在 VS 中调试代码时,出现上述错误。
创建和调用 Batch 的代码如下:
var ws = new com.freud.intranet.lists.Lists {
Url = WebServiceHelper.wsContactsList,
Credentials = WebServiceHelper.AdminCredentials
};
var batch = "<Batch PreCalc='TRUE' OnError='Continue'><Method ID='1' cmd='Update'><Field Name='ID'>" + contactID
+ "</Field><Field Name='Flagged'>" + flag + "</Field></Method></Batch>";
var document = new XmlDocument();
var stringReader = new StringReader(batch);
var xmlReader = XmlReader.Create(stringReader);
var node = document.ReadNode(xmlReader);
ws.UpdateListItems("Master Contact Joining Table", node);
为什么 caml 在 U2U 中工作而不是在 VS 中工作?
从谷歌搜索来看,问题可能是因为我没有使用内部名称,但它确实在 U2U 中运行,这就是我感到困惑的原因。
In sharepoint when trying to update a list I am getting the error:
0x81020014One or more field types are not installed properly. Go to the list settings page to delete these fields.
The Caml that is being created is:
<Batch PreCalc='TRUE' OnError='Continue'>
<Method ID='1' Cmd='Update'>
<Field Name='ID'>4</Field>
<Field Name='Flagged'>False</Field>
</Method>
</Batch>
When I run the Caml from U2U it works fine and the field updates. When I debug my code in VS I get the error above.
The code creating and calling the Batch is below:
var ws = new com.freud.intranet.lists.Lists {
Url = WebServiceHelper.wsContactsList,
Credentials = WebServiceHelper.AdminCredentials
};
var batch = "<Batch PreCalc='TRUE' OnError='Continue'><Method ID='1' cmd='Update'><Field Name='ID'>" + contactID
+ "</Field><Field Name='Flagged'>" + flag + "</Field></Method></Batch>";
var document = new XmlDocument();
var stringReader = new StringReader(batch);
var xmlReader = XmlReader.Create(stringReader);
var node = document.ReadNode(xmlReader);
ws.UpdateListItems("Master Contact Joining Table", node);
Why would the caml work in U2U and not in VS?
From Googling the problem could be because I am not using the intrnal names however it does run in U2U which is why I am confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用列表的技巧是获取正确的 Web 服务位置,将引用的 Web 服务中的 URL 设置为正确的位置,并使用列表中定义的字段名称。
通过选择“设置”下拉菜单并选择“列表设置”项,您可以查看 SharePoint 列表中列表项(列)使用的内部名称。
进入“列表设置”后,单击一列,然后查看 URL 以查看“Field=Name”。这是您创建字段时需要使用的名称。
The trick to working with a List is to get the Web Service Location correct, the URL in the referenced web Service set to the correct location, and use the names of the fields as they are defined in the List.
You can see the internal names used for the list items(Columns) in the SharePoint list by selecting the "Settings" pull down and selecting the "List Settings" Item.
Once in the List Settings click on a column and then look at the URL to see the "Field=Name". That is the name you need to be using when you create your fields.
我在代码中使用了错误的列表,因此出现了错误。
I was using the wrong List in the code hence the error.
此外,您还可以尝试打开 SharePoint Designer 并查看任何给定的列表表单或视图。
如果您稍微寻找一下,您会发现“列表 GUID”、“查看 GUID”以及后面的所有列表列。当使用 GetListItems 检索列表项并且需要使用“ows_”+ ColumnName 解析 XML 时,查看 SPD 特别有用。
Also, you can try opening up SharePoint Designer and taking a peek at any given list form or view.
If you hunt around a little while you will find the List GUID, View GUID, and following that all of the list columns. Looking in SPD is particularly useful when retrieving list items using GetListItems and you need to parse the XML using "ows_" + ColumnName.