How to set filter on boolean record to both true and false?!

danielbouwmeester
Member Posts: 22
I made a table in which I have a boolean field. Also, I made a form for this table on which I want to put three buttons. One to filter the records by the boolean variable field: value = TRUE, one to filter the records by the boolean variable field: value = FALSE. But also I want to put one button on the form to show all the records.
Therefore I created an Global Variable 'filterLabelCustSpecific' of the type 'Boolean'. And then I give the variable a value, based on the button which is pushed. But what value do I give the variable to show all the records, in other words: I want to show the records with value TRUE, but also value FALSE...
I don't know how to do this. Can someone help me out? Thanks in advance!
Therefore I created an Global Variable 'filterLabelCustSpecific' of the type 'Boolean'. And then I give the variable a value, based on the button which is pushed. But what value do I give the variable to show all the records, in other words: I want to show the records with value TRUE, but also value FALSE...
I don't know how to do this. Can someone help me out? Thanks in advance!
"Make it idiot-proof and someone will invent a better idiot..."
0
Best Answer
-
Create one variable as an Option and set the OptionString to False,True,All and then in the OnValidate check the value of the variable.
SETRANGE(Boolean Field); // This will clear the filter
IF Variable = Variable::False THEN
SETRANGE(Boolean Field,FALSE)
ELSE
IF Variable = Variable::True THEN
SETRANGE(Boolean Field,TRUE);
Hope this helps.
Albert
5
Answers
-
Create one variable as an Option and set the OptionString to False,True,All and then in the OnValidate check the value of the variable.
SETRANGE(Boolean Field); // This will clear the filter
IF Variable = Variable::False THEN
SETRANGE(Boolean Field,FALSE)
ELSE
IF Variable = Variable::True THEN
SETRANGE(Boolean Field,TRUE);
Hope this helps.
Albert
5 -
Thank you very much Albert! It works perfectly!"Make it idiot-proof and someone will invent a better idiot..."0
-
@danielbouwmeester - Just thinking if it's Boolean and you want to give both TRUE and FALSE in filter then why to even entertain this in Filter??Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/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