How can I add drop-down list to filter field on the report?

wolfskin
Member Posts: 84
Hi everyone,
I'm not sure anyone has asked this question or not. I've tried to search but still not found the solution.
I created a report by used Bin to be DataItem then I set "Location Code" and "Code" to be ReqFilterFields. while I running the report in request page the field Code does not show drop-down list (please see the image below).

How can I do to display drop-down list to Code field?
Thank you.
I'm not sure anyone has asked this question or not. I've tried to search but still not found the solution.
I created a report by used Bin to be DataItem then I set "Location Code" and "Code" to be ReqFilterFields. while I running the report in request page the field Code does not show drop-down list (please see the image below).

How can I do to display drop-down list to Code field?
Thank you.
0
Best Answers
-
Hello,
you need to add a new Code Variable, which you place on the Request Page.
Then on the Request Page you have to set the Table Relation, which should point to Bin table.
After that you have to use that Code Variable on PreDataItem trigger in order to filter the Bin table.
Hope this helps.best regards,
Thomas Barbut5 -
Hi wolfskin
If you want to be able to specify a proper filter, rather than a single code value, you should add an arbitrary length text variable to your request page, rather than a code variable.
To validate the filter, I tend to set it on a record field of my choice, Then retrieve that filter again and set the variable to the retrieved filter value. As an alternative, or additionally, you might want to use functions from Codeunit 41 TextManagement for this.
For a lookup you need to code your own OnLookup trigger, calling the lookup page for the field you want to filter on. Then use the page function GetSelectionFilter, which is available for some (e.g. Page 22 Customer List) but needs to be added for others. These functions usually use functions in Codeunit 46 SelectionFilterManagement. I believe, though, that these functions will not properly work for primary keys consisting of more than one field. So you would need to create your own.
I did not verify this, but likely you could also alter the table, modifying the properties of the field. Specify the table relation, specifying table and field, and set ValidateTableRelation and TestTableRelation to No. Then, on pages where you can create new records, you might want to disable the lookup on that field again.5
Answers
-
Hello,
you need to add a new Code Variable, which you place on the Request Page.
Then on the Request Page you have to set the Table Relation, which should point to Bin table.
After that you have to use that Code Variable on PreDataItem trigger in order to filter the Bin table.
Hope this helps.best regards,
Thomas Barbut5 -
thomas_barbut wrote: »Hello,
you need to add a new Code Variable, which you place on the Request Page.
Then on the Request Page you have to set the Table Relation, which should point to Bin table.
After that you have to use that Code Variable on PreDataItem trigger in order to filter the Bin table.
Hope this helps.
Hi thomas_barbut, thank you for your suggestion but the variable cannot support in case of user would like to choose multiple values such as A|B or A..Z
I noticed that the table that have one key can display drop-down list such as Item, Vendor, Customer, ect. but the table that contains more than one key like Bin, Product Group , ect. They cannot display the drop-down list on the second key. What did I do wrong? Is it possible?
Thanks0 -
Use relation as Thomas suggest. Code is in primary key, so NAV will allow to define relation to it.0
-
Hi wolfskin
If you want to be able to specify a proper filter, rather than a single code value, you should add an arbitrary length text variable to your request page, rather than a code variable.
To validate the filter, I tend to set it on a record field of my choice, Then retrieve that filter again and set the variable to the retrieved filter value. As an alternative, or additionally, you might want to use functions from Codeunit 41 TextManagement for this.
For a lookup you need to code your own OnLookup trigger, calling the lookup page for the field you want to filter on. Then use the page function GetSelectionFilter, which is available for some (e.g. Page 22 Customer List) but needs to be added for others. These functions usually use functions in Codeunit 46 SelectionFilterManagement. I believe, though, that these functions will not properly work for primary keys consisting of more than one field. So you would need to create your own.
I did not verify this, but likely you could also alter the table, modifying the properties of the field. Specify the table relation, specifying table and field, and set ValidateTableRelation and TestTableRelation to No. Then, on pages where you can create new records, you might want to disable the lookup on that field again.5 -
Hello,
vaprog has a good point. I would certainly give it a try.best regards,
Thomas Barbut0 -
Thank you everyone for the suggestions, I will do these solutions to my program.
Thanks.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions