Dynamics Nav 2013 - Prevent user from clearing the filter

paramb
Member Posts: 85
Hi All,
I have added code to restrict users from viewing/accessing Sales Orders in the Page 9305-Sales Order List based on the Salesperson/Purchaser code in the Sales Order. Each user is assigned a Salesperson in the User setup page. All is fine and the Sales Order List display only the expected sales orders.
But the user can now clear the page filter and see all the sales orders irrespective of the coded filter. I would like to know how can I restrict users with certain rights from clearing the filter.
I have added code to restrict users from viewing/accessing Sales Orders in the Page 9305-Sales Order List based on the Salesperson/Purchaser code in the Sales Order. Each user is assigned a Salesperson in the User setup page. All is fine and the Sales Order List display only the expected sales orders.
But the user can now clear the page filter and see all the sales orders irrespective of the coded filter. I would like to know how can I restrict users with certain rights from clearing the filter.
0
Comments
-
In the code behind set a FILTERGROUP before setting the required filter, with a filter group the user cannot remove the applied filters. Check out the online help for more details http://msdn.microsoft.com/en-us/library/dd338919.aspx.Tim Whitaker | Senior NAV Consultant/Developer | The Software Workshop Ltd. | http://www.thesoftwareworkshop.com0
-
whitaker_tim wrote:In the code behind set a FILTERGROUP before setting the required filter, with a filter group the user cannot remove the applied filters. Check out the online help for more details http://msdn.microsoft.com/en-us/library/dd338919.aspx.
As above, just remember to set the FILTERGROUP back to 0 after setting your filters.0 -
Thanks to all who posted reply.
is it Ok to use the FILTERGROUP(2) and FILTERGROUP(0) one after the other in same trigger.
The following code is from Std Nav 2013.
IF UserMgt.GetSalesFilter <> '' THEN BEGIN
FILTERGROUP(2);
SETRANGE("Responsibility Center",UserMgt.GetSalesFilter);
FILTERGROUP(0);
END;
I have placed my new code just below this code
IF UserSetup.GET(USERID) THEN BEGIN
IF UserSetup."Salespers./Purch. Code" <> '' THEN BEGIN
FILTERGROUP(2);
SETRANGE("Salesperson Code",UserSetup."Salespers./Purch. Code");
FILTERGROUP(0);
END;
END;0 -
It is ok to use more than one filter group but you should be using a filter goup higher than 6 as 0-6 are reserved for use by NAV. See the remarks section of the online help http://msdn.microsoft.com/en-us/library/dd338919.aspx.Tim Whitaker | Senior NAV Consultant/Developer | The Software Workshop Ltd. | http://www.thesoftwareworkshop.com0
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