The purpose of this publication – to describe the ability to filter the data in a form on a “virtual” field using the methods and OnFindRecord OnNextRecord forms in the system Navision (Dynamics NAV). This question is partially lighted at many online resources, but complete decomposition “on the shelves” with concrete examples found in almost unreal. In preparation for publication were collected almost all the “bumps” of the filtration method. If attentive readers will find solutions in the analysis of inaccuracy – please report immediately.
• “virtual” form field – a certain field in a record that is displayed on the form. Not associated with any field in the table. The field value is calculated in a trigger OnAfterGetRecord form.
The customer had a number of forms, which used a “virtual” field. It was necessary to make the mechanism of selection of records. The user should be able to select the entry to one of the following algorithms – all records, only records with a specific status, only the records without a certain status.
- The use of marking mechanism records. Lack – time spent on sorting records and affixing labels, the cost of time.
- The substitution of data records in the form of a virtual table using the methods and OnFindRecord OnNextRecord form. Disadvantage – the need to manage the temporary table at any change records, the cost of time.
- Ignoring the records that do not meet the selection criteria, using the methods and OnFindRecord OnNextRecord form. Lack – is a bit longer than usual form.
Guessed reader, was chosen the latter option.
On the form, were added 4 functions:
In the triggers form was submitted the following code:
The solution is quite fast, and customer satisfaction.
Author: Rafael Batyrshin