FILTERGROUP Example

kriki
Member, Moderator Posts: 9,121
FILTERGROUPS are used in 2 ways:
1) when you want to put multiple filters on the SAME field
2) when you want to hide a filter from the users, so they cannot change/delete it
-Example for 1: I want Customers whose names start with ABC and have XYZ somewhere in their names
-Example for 2: : the use has to select an item from a certain Vendor and he may NOT change (or delete) the filer on the vendor.
1) when you want to put multiple filters on the SAME field
2) when you want to hide a filter from the users, so they cannot change/delete it
-Example for 1: I want Customers whose names start with ABC and have XYZ somewhere in their names
SETFILTER("Customer Name",'ABC*'); FILTERGROUP(6); SETFILTER("Customer Name",'*XYZ*'); FILTERGROUP(0);
-Example for 2: : the use has to select an item from a certain Vendor and he may NOT change (or delete) the filer on the vendor.
recItem.RESET; recItem.FILTERGROUP(6); recItem.SETRANGE("Vendor No.",codVendorNo); recItem.FILTERGROUP(0); IF FORM.RUNMODAL(0,recItem) = ACTION::LOOKUPOK THEN BEGIN ... END;The FILTERGROUP 6 changes the filtergroup in which I put the SETRANGE, then I put the FILTERGROUP back to 0 (the standard one) so the user doesn't see/cannot change my filter on Vendor no.
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
0
Comments
-
I would add one more area of use - reports.
You can do:
Filtergroup(6);
setrange(filed,your filter);
Filtergroup(0);
and then if even you expose the filtered field to the user on the request form, both filters, your and typed by the user, apply.
Regards,
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030
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