Using OData to Count Records in a Table in Dynamics 365 for Finance and Operations
With no direct access to the Dynamics 365 for Finance and Operations (D365FO) database you are relying on OData to execute your queries. A common scenario is the need to count the number of records in a table. The following URL template offers a quick way to do this:
[d365fo-url]/data/[data-entity]/$count
If, for instance, I would like to count the number of customers in my D365FO instance, the URL would look like this:
d365fo384738737aos.cloudax.dynamics.com/data/CustomersV3/$count
A quick an easy way to count records in a table.
The $count function can obviously be combined with the $filter function if you only need to count a subset of records. By adding the following statement to the URL, the request returns the number of customers in group ’10’:
/?$filter=CustomerGroupId eq ’10’
This was originally posted here.

Like
Report
*This post is locked for comments