Filtering Table Box Data

JAKA
Member Posts: 18
Hello.
I need to filter data shown on a table box according to the data retrieved.
Simple example: I have a form linked to Table Sales Invoice Header and a Table Box.
I would like to see only the records where Sell-to Customer No. <> Bill-to Customer No.
I tried to add filter to Form On_Init (and other triggers too)
But this has no effect. Is this just too simple or am I looking from a wrong point of view?
I need to filter data shown on a table box according to the data retrieved.
Simple example: I have a form linked to Table Sales Invoice Header and a Table Box.
I would like to see only the records where Sell-to Customer No. <> Bill-to Customer No.
I tried to add filter to Form On_Init (and other triggers too)
SETFILTER("Sell-to Customer No.", '<>%1', "Bill-to Customer No.");
But this has no effect. Is this just too simple or am I looking from a wrong point of view?
0
Answers
-
Sorry, here NAV works a little bit different as, for example SQL.
The filter setfilter(Field,'<>%1',Field2); //Field2 <- must have a value it's not dynamic (not so simple).
So for your solution you must go through (loop) the rec's.
The Recs, where Sell-to Customer No." <> "Bill-to Customer No." you store (for example in a temporary table, don't use mark if you have many records in your table and you are under sql) and after your loop you show the founded records.
RegardsDo you make it right, it works too!0 -
You cannot do this with a variable or a function without using either a temporary table or something like MARK. To apply directly a filter it must be a Table field...
You could add a flowfield that returns the equation and filter on that...0 -
Thank you garak and kapamarou!
My actual task was a bit different from my example but you helped me to see what the problem is. I finally added a field to source table, evaluated my comparison to it and filtered by this new field.
I'm not totally comfortable with this but it does what I wanted.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