Filter max length

mabl4367
Member Posts: 143
I have a report that builds a string to be used as a filter for the item no. field.
Is there a limit for how long a filter can be?
If so I'd like to make my report handle it in a nice way.
Is there a limit for how long a filter can be?
If so I'd like to make my report handle it in a nice way.
0
Answers
-
There is a limit (I don't remember exactly how many chars). There are three solutions (the third I think is the best...)
1. Build the filter in the form A|C..K|Z.
2. Use MARK.
3. Use a temporary table to store the records you want. Then an
IF TempRec.GET(KeyValue) THEN BEGIN
END;
is like a filter...0 -
I believe the maximum filter string length is 250 characters. The issue of over flowing filterstring happens a lot when it is built in code like that. You'll need to program a check to make sure it doesn't go over.0
-
as i know the maxlenght is ~ 440.
for i := 1 to 1024 do begin if Strlen(Filtercode) = 0 then Filtercode := format(i) else begin if strlen(Filtercode + '|' + format(i)) <= 440 then Filtercode := Filtercode + '|' + format(i); end; end; message(format(strlen(Filtercode))); Item.setfilter("No.",Filtercode); Form.runmodal(0,Item);
RegardsDo you make it right, it works too!0 -
250 characters.... I think I've heard that somewhere else to. But if Garak is right its around 440.
Perhaps 250 chars are guarantied to work and larger filters may work under special circumstances.
It would be good to know the exact maximum number of characters guarantied to work and even better to know why.0 -
So build a filter string, one character at a time, and set it as the filter. When it errors out, you will know the answer.
By the way, 440 does not sound right to me. I remember getting errors as soon as the length hits 250. It might have changed though. One way to find out: test it.0 -
With the test code snippes above, the filterstring on Item no is >250. It's 439.
Maybe the problem in older versions was the Variable lenght of 250.
Now it's max 1024.
Also possible, that MS has changed the max. Filtercriteria parameter.
regardsDo you make it right, it works too!0 -
OK
Thank you all for your help. I'll stay under 250 chars and I'll be ok.0 -
Just be careful... Item No. is 20 chars. It can easily get out of range...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