How to use the Query object as an API in Business Central

Queries are a compelling object type within Business Central, as they allow us to retrieve records from one or more tables and then combine them in rows and columns into a single dataset.

This object type also allows you to perform calculations such as limiting the number of rows to retrieve, sorting data, and finding the sum or average of all the values in a specific column.

Source : Ivan Singleton
Read more…

D365 Business Central : Using Query to Get Distinct Values

When working with table data, there will be times when we need to retrieve a unique record value from the table (also called SELECT DISTINCT). Unfortunately, D365 Business Central does not provide this logic out of the box. We will need to find a way to do this ourselves.

Source : That NAV Guy
Read more…

Business Central API – Filter Child Array Values Using $filter Query Option

I had a difficult time finding an example of this type of API filtering using the OData $filter query option, so I wanted to share an example that I needed for a project.

For context, this is a very simple example of a Business Central API “child array” that I wanted to filter. Technically, I think that OData calls this an “expanded navigation property”.

Source : Steve Endow
Read more…