Filter without modification

Ecc
Member Posts: 3
Hi!
I've built a tabular type form that has a table in its source and shows its contents. Than I added a textbox, set its sourceexpr to a global variable und added
Thanks in advance!
I've built a tabular type form that has a table in its source and shows its contents. Than I added a textbox, set its sourceexpr to a global variable und added
record.RESET; record.SETRANGE(Column, Filter); record.SETCURRENTKEY(OtherColumn); record.FINDFIRST;to the OnValidate-Event of that textbox. Filtering works, but when the tablebox looses its focus, I get a message telling me that I cannot modify the forms source table. But i didn't change anything in the tablebox. When i put the same C/AL-Code in the OnPush-Event of a button, everything works _without_ that messagebox. How can i get rid of that message?
Thanks in advance!
0
Comments
-
Put your code in the OnAfterValidate trigger, also call CurrForm.Update(FALSE) instead of FINDFIRST (it will fail if no records are found). E.g. if you have a form with sourcetable Customer, with variable NameFilter, you can use something like this:
IF NameFilter = '' THEN SETRANGE(Name) ELSE SETFILTER(Name, NameFilter); CurrForm.UPDATE(FALSE);
You can also check the standard forms like 7002, to get an idea.0 -
Thanks a lot, it works now. :-)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