odata - 计算 Dynamics CRM Online web api (ODATA) 中的所有行
问题描述
是否可以计算给定实体中的所有行,绕过 5000 行限制并绕过页面大小限制?
我不想在一个请求中返回超过 5000 行,而只想要该给定实体中所有行的计数。
根据 Microsoft 的说法,您不能在请求 URI 中执行此操作:
The count value does not represent the total number of entities in the system.
It is limited by the maximum number of entities that can be returned.
我试过这个:
GET [Organization URI]/api/data/v9.0/accounts/?$count=true
还有什么办法吗?
解决方案
如果要检索超过 5000 条实体的记录总数,请使用 RetrieveTotalRecordCount 函数。
您的查询将如下所示:
https://<your api url>/RetrieveTotalRecordCount(EntityNames=['accounts'])
推荐阅读
- python - 使用 pymongo 更改流检索删除操作的完整删除文档
- azure - 是否有任何 REST API 可用于列出 azure 资源组的所有者?
- javascript - 如何在特定半径内显示 react-native-maps
- javascript - 在 React 中使用 Axios POST 时出现 400 BAD REQUEST
- c# - 如何根据C#中的另一个属性值获取XML节点的属性值
- angular - 使用日期时间选择器获取没有时区的日期和时间
- javascript - @rollup/plugin-node-resolve 抛出错误:无法读取未定义的属性“长度”
- mysql - 是否使用某种 for 循环进行选择是 SQL 中的错误方法?
- php - How to make laravel relations to work properly?
- javascript - why getting wrong result while multiplying in javascript?