Filtering out Operator characters

sarkie83
Member Posts: 22
We have got some instances where Item No's contain the equals (=) character.
And I always seem to get an error when trying to filter it out:
I can do table filters ok on forms, etc...
Thanks
And I always seem to get an error when trying to filter it out:
recItem.RESET; recItem.SETFILTER("Last Date Modified",'<%1',RefDate); recItem.SETFILTER("No.",'<>*%1*','='); IF recItem.FINDFIRST THEN REPEAT ... ...
I can do table filters ok on forms, etc...
Thanks
0
Answers
-
I don't know what type of error you can get, but...
1. filters like <>*something* does not always work (it depends on nav version and if SQL or not)
2. (the most important) '=' is a wildcard, it's not good to have it in your fields, especially in such an important field like the item no.
the solution of your problem CAN be to loop the resulting recordset before th <>*=* filter, and check with strpos function if the item code contains '=', then mark the record or populate a temptable...0 -
Belias wrote:2. (the most important) '=' is a wildcard, it's not good to have it in your fields, especially in such an important field like the item no.
the solution of your problem CAN be to loop the resulting recordset before th <>*=* filter, and check with strpos function if the item code contains '=', then mark the record or populate a temptable...
If you could rename those items so that No. do not contain that kind of characters... that'd be way much easier.
That happen to me with a Vendor No. containing character & (M&C, i think the vendor No. was)
When filtering for that specific vendor, Navision didn't understand I wanted to filter per 'M&C' as a whole, Navision actually looked for a vendor who's No. was M and C at the same time.
I renamed it and, of course, solved the problem.
Waaay much easier than having to populate a temptable every single time an user filters on that field....0 -
Thanks for your replies - I agree that this character should not be appearing in the No. field anyway - so those instances that have appeared I have deleted, and ammended the responsible dataport to trap for anymore...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