How to filter an Integer field

jam176
Member Posts: 27
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
But all of this is not allowed conversion...
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...
thx
jam176
jam176
0
Comments
-
did you try this??
>> 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 good0 -
In your case, when you have whole filter in the string you need to use:
FILTERSTRING:= '1..10'; table.setfilter("field", FILTERSTRING);
0 -
ahhh!!!
thank you KINE, that's it!
(thank you leugim also, but my problem was the usage of a filterstring!)[/code]thx
jam1760
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