Insufficient C/AL Stack Memory

Hi, I have got a strange error “Insufficient C/AL Stack Memory” in NA3.60 with Hot Fix 38 on Native Database and SQL. Here is how i got it, hope someone can help me out. 1. I have any arrary variable A of dimension 10 X 1000 in which i store the Document No. filter (Ex : DOC01|DOC05|DOC08…) 2. I use this arrary variable A to apply filter using Setfilter command on a FlowFilter Field in OnOpenForm() trigger. (Ex : setfilter(“Doc. No. Filter”,A[1]+A[2]+A[3]…A[10]) ) I went through the previous posting relating to Stack Memory, but i don’t find any recursive calls in the above. I also noted that if the arrary is until 300 Bytes the system allow and above it pops up the error. Is there an alternative to my above situation in case the above is a technical limitation. Thanks in advance for comments cheers, JHC

Sorry i tried again and found that the max. byte limit was close to 720 Bytes… but still my problem exist…[B)]

Navision does a stack memory allocation test each time it needs to allocate local variables or call a function recursively. If it fails you get your error. Without looking more into it I don´t remember if this also applies to global variables but I suspect so. Is your array global? Why do you need as many as 10000 in the second dimmension?

Hi, The array variable A is 10 dimesion with 1000 char each, so that i can achive 10000 chars (Navision Text variable max. length is only 1024, which is not sufficient) in total, the reason being i have to collect all Sales Order Nos. for a customer for period like 6 month or 1 Year that is entered by the user in a separate table. Ex : Cust001 order001 Cust001 order023 . . Cust001 order897 Secondly i have tried using both global and local variable doesn’t make any difference, same error occurs. Basically i pass this array variable to codeunit function by reference and fill it up and bring it back to the form. cheers, JHC

Can’t you just pass a record variable which is already filtered, perhaps using the MARK and MARKEDONLY functions?

Hi, The problem is i need the filter to be used as a flowfilter to be applied on a flow field. To give u a picture of my situation, i am having a item list form, with Inventory flowfield in this form. Now assume that i have a flowfilter Doc. No. Filters on Item Table used on Inventory Field, to which i would like to pass the value DOC01|DOC02|DOC03…DOCXX, now this string cann’t be greater than 700 Bytes or so. cheers, JHC

Yes, that’s unfortunately true. I’ve just tried Navision 4.0 and the maximum length for a code filter is 683 characters. Any more and you get an error message stating “The filter ‘684 CHARACTER LONG FILTER’ is invalid.” I don’t think you will be able to overcome this problem using your current approach. It is probably better to look at a design change in order to avoid the need to build up such a huge filter. If you need suggestions, feel free to post your requirements.