web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Using OData to Count Records in a Table in Dynamics 365 for Finance and Operations

Henrik Larsen Profile Picture Henrik Larsen 646

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’

Advertisements

This was originally posted here.

Comments

*This post is locked for comments