Queries
Reports have always been available in Business Central as a data retrieval tool. Reports are used to process and/or manipulate the data through the Insert
, Modify
, or Delete
procedures, with the option of presenting the data in a formatted, printable format. The query
object was created with performance in mind. Instead of multiple calls to SQL to retrieve multiple datasets, which would then be manipulated in AL, queries allow us to utilize familiar Business Central tools to create advanced T-SQL queries.
A Business Central developer can utilize the query
object as a source of data both in Business Central and externally. Some of the external uses of Business Central queries are as follows:
- A web service source for OData or as a REST API endpoint. Queries of the API type are used to generate web service endpoints and this type of query cannot be used to display data in the user interface. A query of the API type can be used to join data from different data sources...