Selection of data using triggers OnFindRecord, OnNextRecord form in Navision

Category: Stories Post Date: 15.01.2013

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.

Case history

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.

Possible Solutions

  • 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:

1. ShowThisRecord

2. FINDPosition

3. NEXTPosition

4. CheckAdditionsExists

In the triggers form was submitted the following code:

1.    OnFindRecord

2.    OnNextRecord



The solution is quite fast, and customer satisfaction.


Author: Rafael Batyrshin

Leave a Reply