Filtering
Filtering is one of the most powerful tools within NAV. Filtering is the application of defined limits on the data that is to be considered in a process. When we apply a filter to a Normal data field, we will only view or process records where the filtered data field satisfies the limits defined by the filter. When we apply a filter to a FlowField, the calculated value for that field will only consider data satisfying the limits defined by the filter.
Filter structures can be applied in at least three different ways, depending on the design of the process:
- The first way is for the developer to fully define the filter structure and the value of the filter. This might be done in a report designed to show information on only a selected group of customers, such as those with an unpaid balance. The Customer table would be filtered to report only customers who have an outstanding balance greater than zero.
- The second way is for the developer to define the filter structure, but allow the user to fill in the specific value to be applied. This approach would be appropriate in an accounting report that was to be tied to specific accounting periods. The user would be allowed to define what periods are to be considered for each report run.
- The third way is the ad hoc definition of a filter structure and value by the user. This approach is often used for general analysis of ledger data where the developer wants to gpe the user total flexibility in how they slice and dice the available data.
It is common to use a combination of the different filtering types. For example, the report just mentioned that lists only customers with an open balance (through a developer-defined filter) could also allow the user to define additional filter criteria. If the user wants to see only Euro currency customers, they would filter on the Customer Currency Code field.
Filters are an integral part of the implementation of both FlowFields and FlowFilters. These flexible, powerful tools allow the NAV designer to create pages, reports, and other processes that can be used under a wide variety of circumstances. In most competitpe systems, standard user inquiries and processes are quite specific. The NAV C/AL toolset allows us to have relatpely generic user inquiries and processes, and then allow the user to apply filtering to generate results that fit their specific needs.
The user sees FlowFilters filtering referred to as Limit Totals onscreen. Application of filters and ranges may gpe varying results depending on Windows settings or the SQL Server collation setup. A good set of examples of filtering options and syntax can be found in Developer and IT Pro Help in the section titled Entering Criteria in Filters.