Automatically filtering records when user opens a form

david.weeks
Member Posts: 96
Hello All,
I have used the table filter within SourceTableView to automatically apply a filter on the open field when the user opens the customer ledger entry table.
However, when they press SHOWALL button, I want all entries to be displayed including entries that are not open. But at the moment, pressing SHOW ALL just lists all open entries for all customers.
Ideas?
Thanks
I have used the table filter within SourceTableView to automatically apply a filter on the open field when the user opens the customer ledger entry table.
However, when they press SHOWALL button, I want all entries to be displayed including entries that are not open. But at the moment, pressing SHOW ALL just lists all open entries for all customers.
Ideas?
Thanks
0
Comments
-
Hi,
I have solved this problem by not using the sourcetableview.
I have used SETFILTER within the OnInit of the form.
However, and this is already part of Navision, when you press SHOWALL, it shows all records for all customers (i.e. as per usual).
Any way of keeping the customer filter when pressing Show All?
Thanks0 -
Try this:
Put the code below in a codeunit, and call it like cdu.fctSetFilter(Rec);fctSetFilter(VAR prec: Record "Record Of Form") WITH prec DO BEGIN FILTERGROUP(2); SETCURRENTKEY(field1,field2); SETRANGE(field1,'test1'); SETRANGE(field2,'test2); FILTERGROUP(0); END;
Tip: Read the C/SIDE help on FILTERGROUP, it explains a lot!0 -
and it is not needed to have this code in cu, you can have your function on table/form or even without function. depends on where else you would like to apply your filtering. important part is between BEGIN and END®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯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