Selection of data using triggers OnFindRecord, OnNextRecord form in Navision

Updated: 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.

Definitions:

• "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.

Implementation
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  

Finalizing

The solution is quite fast, and customer satisfaction.

Author: Rafael Batyrshin

 

Other blog posts

24.05.2018
Disclaimer
08.05.2018
We apply OKR methodology in Neti since 2014. We started from a quarterly planning, but then understood that no ambitious goals can be achieved per quarter. So we switched to semi-annual intervals....
11.04.2018
As you know, Microsoft recently has launched Dynamics 365 Business Central. And we are proud to announce we have launched intracompany training for sales and development departments:Why do we need it...

Subscribe for blog updates

Get updated with our blog new articles via your email!


Subscribe now