Microsoft Dynamics NAV is an information system, and its primary purpose is to collect, store, organize, and present data. Therefore C/AL has a rich set of functions for data access and manipulation.
The next example will present a set of basic functions to read data from the NAV database, filter and search records in a table, and calculate aggregated values based on database records.
In this example, suppose we want to calculate the total amount in all open sales orders and invoices for a certain customer in a specified period.
OnRuntrigger, and open the local declarations ...