Prevent user from selecting specific data in report filter

ayashi
Member Posts: 78
Dear all,
How do I prevent user from selecting specific data in report filter ?
Eg :
If I open Whse.Shipment Status, for field location I already filter in location list form to only show Location code 'GREEN' and 'BLUE'.
But if user manually type 'WHITE' value in location code field, the report can still running. How do I prevent this ?
Thanks In Advanced
How do I prevent user from selecting specific data in report filter ?
Eg :
If I open Whse.Shipment Status, for field location I already filter in location list form to only show Location code 'GREEN' and 'BLUE'.
But if user manually type 'WHITE' value in location code field, the report can still running. How do I prevent this ?
Thanks In Advanced
0
Comments
-
Let the user change it if he wants.
Overrule the filter of the user by putting some code in the OnPreDataItem-section of the report.
Something like
SETFILTER("Location Code",'Your Filter');
Probably you did something like this in the form.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Or you can use another filtergroup to apply your filter. In this case, user can filter what he want, but you will limit the locations he can see. Because the result will be interception between your filter and user filter.0
-
Hi all, thx for responding,
@Kriki, what if I want to show error message if the user put invalid value (unlike in the table that already limited by filter) ? By using the code you provide, it would force the data to filter by the value I entered.
@kine, I already limit the location user can see, but I can't stop user from input manually other value beside the one that can be seen by them.0 -
No, I mean use the filter in the report, not on the "lookup". Just add the filter KRIKI wrote, but add it into another filter group. The user filter will be preserved, but your filter will be used too and result will be the intersection and that's what you want... :-)0
-
ayashi wrote:@Kriki, what if I want to show error message if the user put invalid value (unlike in the table that already limited by filter) ? By using the code you provide, it would force the data to filter by the value I entered.
In stead of overwriting the filter (or like kine wrote:putting it in anther filtergroup), you can test if the filter the user has put is valid and if not just give an ERROR.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
@kine
hi, sorry, i'm still newbie in navision, i'm a little bit confused when reading "add it into another filter group", could you kindly described it to me what is this mean ? thx
@kriki
"you can test if the filter the user has put is valid"
How do I get the value that user input ? Cause if i just put code :
Message("location code"), it gives me empty string, even when I alread put the value in the filter.
Thx0 -
Please, read on-line help for command FILTERGROUP. Short Description: filter group is something like "layer" of filters. There are many Layers in which you can set filters and result is the intersection of the filters. One layer are filters set through SourceTableView property, another is user defined filters, another are filters from RunFormLink etc...0
-
@kine,
thx a lot, after browse this forum, I finally understand the meaning, and able to solve my problems.
Thanks to you all0
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