Expressions in query ranges – limitations
When you want to construct a query-object that contains OR-conditions, you can construct something like this:
1 2 3 4 5 6 | queryBuildRange.value(strFmt('((%1 == %2) || ((%1 == %3) && (%4 == "%5")))', fieldStr(InventTable, ItemType), any2int(ItemType::Service), any2int(ItemType::Item), fieldStr(InventTable, ProjCategoryId), queryValue("Spares"))); |
(you can find more info on Axaptapedia: Expressions in query ranges)
Now there is a limitation to this way of working. When the generated string in the queryBuildRange.value is longer than 250 characters (the length of the range EDT), Ax cuts the generated string off when you open the ‘modify query’ dialog. I have tried to enlarging the EDT, but is not a good solution. The error does not occure when you open the ‘modify query’ dialog, but it occures when you close it.
A small (but limited) work-around could be to make the name of the datasources on the form/report where you want to apply this trick smaller. I hope to find a better solution, but this does the trick for now.
Tags: Ax 4.0, Ax 5.0 (2009), Dynamics AX, Forms, Query, QueryRun, Tips & Tricks, X++
This entry was posted on Friday, April 9th, 2010 at 06:00 and is filed under Dynamics AX. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


April 9th, 2010 at 09:47
Hi Jeroen,
Maybe this will help you out:
http://www.artofcreation.be/2010/04/09/split-and-add-ranges-on-datasource/
It only does comma serparated ranges, but you might be able to apply the principle of spitting to you ranges with expressions.
Regards.
April 15th, 2010 at 11:05
Klaas,
It wasn’t a solution for this problem, but it is was the solution to a other problem
Thx!