Hello Friends,
There is a new datatype
introduced in NAV 2016 and it is called FilterPageBuilder, this datatype can be
used to create a filter page that enables users to set filters on multiple
tables. The page can have multiple controls i.e. multiple records and you can
use that to capture filters on the records.
The following are the functions that are available for this datatype.
The following are the functions that are available for this datatype.
- ADDTABLE
- ADDRECORD
- ADDRECORDREF
- ADDFIELD
- GETVIEW
- SETVIEW
- RUNMODAL
- COUNT
- NAME
Following is an example how it
can be used
FilterPageBuilder
---- SubType
of
FILTERPAGEBUILDER
FilterPageBuilder.ADDTABLE(‘Customer Table’,DATABASE::Customer);
FilterPageBuilder.ADDTABLE(‘Item Table’,DATABASE::Item);
FilterPageBuilder.RUNMODAL;
The above code will open the following page
You can also specify the field
like we do using ReqFilterFields property on the request page of the report
using ADDFIELD function below is another example
Customer is the record variable of Customer Table
Customer is the record variable of Customer Table
FilterPageBuilder.ADDRECORD('Customer Table',Customer);
FilterPageBuilder.ADDFIELD('Customer Table',Customer."No.");
FilterPageBuilder.RUNMODAL;
As you can see the first parameter should match with ADDRECORD to let the control know which field to show.
Once the user sets the filter on the page, we can get the
filters from the page using GETVIEW function of the FilterPageBuilder and then
set that to another record.
Ex.
Ex.
Customer2.SETVIEW(FilterPageBuilder.GETVIEW(Customer));
Where Customer2 is another customer record variable.
Use the New DataType FILTERPAGE Builder option which is avaialable in Nav 2016 and easily create a filter page and easily control multiple records. Lot of thanks for this great information about microsoft dynamics nav.
ReplyDelete