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

14.11.2017
Why outsourcing company is more effective than In-house IT-specialists There are situations when in-house specialists spend most of their time awaiting requests or they cannot get their work...
26.09.2017
Microsoft Dynamics AX program decisions are constantly improving. At first, innovations come to European companies, and only after that to Russian enterprises.We aspire to be one step ahead in this...
28.08.2017
Notes of the summit and of Dynamics market in Russia. Neti has been specializing in AX development since 2003. Our sphere of interest is the cutting-edge MS Dynamics technology. We find, study...

Subscribe for blog updates

Get updated with our blog new articles via your email!


Subscribe now