【问题标题】:Count records returned from $extend in Dynamics 365 Web API计数从 Dynamics 365 Web API 中的 $extend 返回的记录
【发布时间】:2019-02-14 19:58:53
【问题描述】:

基本上,我有这样的东西:

https://company.crm.dynamics.com/api/data/v9.0/accounts?$select=accountid,accountnumber,name&$expand=crm_productbuyer($select=name)

我希望能够只计算$expand 中返回的记录数,而不是在 C# 中对其进行反序列化并对其进行计数。只需一件事即可迭代。

这对我的情况不起作用:

API $expand and &count

编辑:

这里有很多事情表明这是不可行的:

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/retrieve-entity-using-web-api#retrieve-related-entities-for-an-entity-by-expanding-navigation-properties

您不能使用 /$ref 或 /$count 路径段仅返回相关实体的 URI 或相关实体的数量。


这是 OData 版本 4.0 第 1 部分:协议加勘误表 02 的“11.2.4.2.1 扩展选项”部分中描述的系统查询选项的子集。选项 $skip、$count、$search、$expand Web API 不支持 $levels。​​

除非其他人插话来证明,否则会将其标记为答案。

【问题讨论】:

标签: microsoft-dynamics dynamics-365 dynamics-crm-webapi


【解决方案1】:

听起来不可行:

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/retrieve-entity-using-web-api#retrieve-related-entities-for-an-entity-by-expanding-navigation-properties

您不能使用 /$ref 或 /$count 路径段仅返回相关实体的 URI 或相关实体的数量。


这是 OData 版本 4.0 第 1 部分:协议加勘误表 02 的“11.2.4.2.1 扩展选项”部分中描述的系统查询选项的子集。选项 $skip、$count、$search、$expand Web API 不支持 $levels。​​

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-26
    • 1970-01-01
    • 2018-10-04
    • 2020-09-02
    • 1970-01-01
    相关资源
    最近更新 更多