Hi everybody!
As it works in all tables with the built-in navision filter there must be a possibility to filter an Integer field by program.
I tried
FILTERSTRING:= '1..10';
table.setrange("field", FILTERSTRING);
table.setfilter("field", '%1', FILTERSTRING);
But all of this is not allowed conversion...
Comments
>> table.SETFILTER("field", '%1..%2',1,10);
>> table.SETRANGE("field",1,10);
with SETFILTER you are using internal variables %1 and %2, which are replaced by 1 and 10. and with SETRANGE you are setting a range from 1 to 10 (both included). of course, "field" must be a numeric field (integer, decimal, biginteger...)
codeing SETRANGE or SETFILTER like that the result must be the same
please take a look at Navision Technical help: designing an object, open code window, press F5 (symbol menu), select a table in left column, select FILTER option in middle column and finally select SETRANGE/SETFILTER in right column. then press F1 and SETRANGE/SETFILTER help appears, showing the correct syntax, some explanations about how it works and some examples you can copy to your code
hope this will help. regards
so far, so good
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
thank you KINE, that's it!
(thank you leugim also, but my problem was the usage of a filterstring!)[/code]
jam176