Problem with setfilter

poppins
Member Posts: 647
Hi everyone,
I want to set a filter on a record:
SETFILTER(Code,'<>%1',txtFilter);
I am using a function to generate the filter and sometimes it gives something like A|B
The problem is that the filter is not applied correctly.
I tried Message(MyRec.GETFILTERS); and I got the following : Code <> 'A|B'.
This is leading to false results (it looks like it is considering A|B as a code not a filter , not <>A & <>B).
Is there something wrong with my syntax?
How should it be?
THnaks in advance
I want to set a filter on a record:
SETFILTER(Code,'<>%1',txtFilter);
I am using a function to generate the filter and sometimes it gives something like A|B
The problem is that the filter is not applied correctly.
I tried Message(MyRec.GETFILTERS); and I got the following : Code <> 'A|B'.
This is leading to false results (it looks like it is considering A|B as a code not a filter , not <>A & <>B).
Is there something wrong with my syntax?
How should it be?
THnaks in advance

0
Answers
-
What is the value you want to filter
1. A|B (If you are looking for Records A or
2. <>A AND <>B (If you are looking for Records other than A and
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
SETFILTER(Code,'<>%1',txtFilter); is not going to work as '%1' always looking for some value. the OR in this context will not work even if you will set write filter like SETFILTER(Code,txtFilter) where your txtfilter is '<>A|<>B'. it will not filter out. if you set txtfilter value to '<>A&<>B' could be work.
you can search forum, there has been so many post for Setfilter which may clear your doubt. one of them is forum.mibuso.com/discussion/46941/setfilter-blank-is-not-working-in-range-case0 -
Instead of building huge filterStrings you should consider using MARK if applicable.Austrian NAV/BC Dev0
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