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:
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
Answers
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...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
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....