gpt4 book ai didi

javascript - 基于多选字段中的扩展列的 REST 查询(Listdata.svc)

转载 作者:行者123 更新时间:2023-12-03 05:57:40 26 4
gpt4 key购买 nike

我有一个 SP2010 客户端应用程序进行 REST 调用。我有一个很大的列表,我想使用名为“显示”的无或多个选择字段的值进行过滤查询。我无权添加到此代码的服务器端代码。

当我“展开”查询时,我可以像这样访问选择的值

myDataVar.d.results[0].Displays.results[0].Value

因为将 1000 行拖到客户端来显示 20 行是残酷且不寻常的网络惩罚,所以我需要在 .Displays.results[0].Value 上过滤 d.results

我已经尝试过这个:

[site]/_vti_bin/Listdata.svc/MasterDataList?$filter=Displays/Value eq 'Wide'

我收到了错误消息

"No property 'Value' exists in type 'System.Collections.Generic.IEnumerable`1[[Microsoft.SharePoint.Linq.DataServiceEntity, Microsoft.SharePoint.Linq, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c]]' at position 9."

another thread我已经尝试过

/_vti_bin/Listdata.svc/MasterDataList?$filter=DisplaysValue eq 'Wide'&$expand=Displays

错误:

位置 0 处的类型“Microsoft.SharePoint.Linq.DataServiceEntity”中不存在属性“DisplaysValue”。

测试不带“值”后缀的“显示”,错误为:

运算符“eq”与操作数类型“System.Collections.Generic.IEnumerable`1[[Microsoft.SharePoint.Linq.DataServiceEntity、Microsoft.SharePoint.Linq、Version=14.0.0.0、Culture=neutral、 PublicKeyToken=71e9bce111e9429c]]' 和位置 9 处的“System.String”。

<小时/>

我再次陷入了 2010 年的困境,提前致谢。

最佳答案

您尝试的方法仅适用于非多选的选择列。不幸的是,REST 接口(interface)不支持多选选择列。显然,SharePoint 2013 也是如此。

FWIW,当我尝试从 SharePoint 中的 Angular JS 应用程序执行相同的操作时,我遇到了同样的问题。我最终创建了自己的多值选择字段实现,然后将结果数据以 JSON 格式存储在 SharePoint 的多行文本列内。这让我可以毫无问题地使用 REST 查询该字段。

关于javascript - 基于多选字段中的扩展列的 REST 查询(Listdata.svc),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39854033/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com