There have been several threads in the past discussing filter string length limitations. The conclusion seemed to be that 250 (earlier versions) or 449? was a limit.
If you use the new Item Attributes functionality and filter the Item List using an Attribute filter, NAV creates a (very long) filter string that you can see on the Page.
A text variable is now unbounded - does this mean that the character limit on a filter string has "gone away"?
Does anyone know if this is the case and if so from what release of NAV (or CU) it is valid from?
Thanks for any information.
0
Comments
It max out at 2gb of data i think.
However there is another limitation, which arises from SQL Server as a platform, and the way how NAV builds the SQL queries.
If you use a pipe in the filter expression NAV prepares a parametrized SQL query executing sp_prepare, which has a WHERE clause looking like The query is then executed by using sp_execute, and all individual values are passed as the parameters to the query.
Unfortunately, SQL Server has a hardcoded limit of maximum 2100 parameters which can be passed to a query. Therefore quite likely your filter will not be limited by the length of new text variables, but by the number of item numbers separated by the |
(Unless of course NAV coders were smart and coded some workaround for longer filters...)
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I then switched to another database running CU5 and the same code seemed to work to much higher levels (19,000 + characters in the string).
So I really don't have a firm conclusion but there certainly are limits and it seems variable.
Not sure how NAV can filter Item Attributes like this??
Item.FINDFIRST;
filterstring := Item."No.";
FOR kounter := 1 TO 1300 DO BEGIN
Item.NEXT(1);
filterstring := filterstring + '|' + Item."No.";
END;
MESSAGE(FORMAT(STRLEN(filterstring)));
CLEAR(Item);
Item.SETFILTER("No.",filterstring);
MESSAGE(FORMAT(Item.COUNT));
Easy. You prepare your test database with 140+ items and all works like charm
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03