Pass flowfilters as parameter
Quivelus
Member Posts: 24
Hi all,
It seems as only 3 flowfilters can be passed as parameter. When working with version 5.00 on a SQL Server, I need to pass 4 flowfilters as parameter to filter on an entry table. The reason why we pass 4 different parameters and not a record variable, is because we need the function to be called for different tables. See example code (not the code I have, but simplified to show what causes the error). When we try the function with only 3 flowfilters (no mather which ones), no error is shown by Navision. Anyone a clue?
Error I receive =
There is not sufficient available space in the C/AL stack memory to execute this task.
There are too many simultanious activities, due to the way recursive function call is used in the program. The problem can be solved temporarily by shutting down some of the open activities (but the function still cannot be executed).
It must be notices that I do not seem to use recursion..
It seems as only 3 flowfilters can be passed as parameter. When working with version 5.00 on a SQL Server, I need to pass 4 flowfilters as parameter to filter on an entry table. The reason why we pass 4 different parameters and not a record variable, is because we need the function to be called for different tables. See example code (not the code I have, but simplified to show what causes the error). When we try the function with only 3 flowfilters (no mather which ones), no error is shown by Navision. Anyone a clue?
// Function: OnRun()
Fct_CalcItem(Lrec_Item); // Fails
Fct_CalcProductGroup(Lrec_ProductGroup); // Succeeds
Fct_CalcItemCategory(Lrec_ItemCategory); // Succeeds
// Function: fct_ApplyFilters(VAR Prec_ItemLedgerEntry : Record "Item Ledger Entry";Ptxt_LocationFilter : Text[250];Ptxt_VariantFilter : Text[250];P
IF Ptxt_LocationFilter <> '' THEN
Prec_ItemLedgerEntry.SETFILTER("Location Code", Ptxt_LocationFilter);
IF Ptxt_VariantFilter <> '' THEN
Prec_ItemLedgerEntry.SETFILTER("Variant Code", Ptxt_VariantFilter);
IF Ptxt_LotNoFilter <> '' THEN
Prec_ItemLedgerEntry.SETFILTER("Lot No.", Ptxt_LotNoFilter);
IF Ptxt_SerialNoFilter <> '' THEN
Prec_ItemLedgerEntry.SETFILTER("Serial No.", Ptxt_SerialNoFilter);
// Function: Fct_CalcItem(VAR Prec_Item : Record Item)
// fct_ApplyFilters throws the error shown below
fct_ApplyFilters(Lrec_ItemLedgerEntry,
Prec_Item.GETFILTER("Location Filter"), Prec_Item.GETFILTER("Variant Filter"),
Prec_Item.GETFILTER("Lot No. Filter"), Prec_Item.GETFILTER("Serial No. Filter"));
// Function: Fct_CalcProductGroup(VAR Prec_ProductGroup : Record "Product Group")
fct_ApplyFilters(Lrec_ItemLedgerEntry, Prec_ProductGroup.GETFILTER("Location Filter"), '', '', '');
// Function: Fct_CalcItemCategory(VAR Prec_ItemCategory : Record "Item Category")
fct_ApplyFilters(Lrec_ItemLedgerEntry, Prec_ItemCategory.GETFILTER("Location Filter"), '', '', '');
Error I receive =
There is not sufficient available space in the C/AL stack memory to execute this task.
There are too many simultanious activities, due to the way recursive function call is used in the program. The problem can be solved temporarily by shutting down some of the open activities (but the function still cannot be executed).
It must be notices that I do not seem to use recursion..
Bohr-ing.
0
Answers
-
Instead of putting the GETFILTER directly in the function call, create local text variables and put the GETFILTER in those and then call the functions with your local variables.
The error you had, can also occur when your function-call is to complicated because you too many other function calls in that function-call.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Just lucky shoot (because i don't know this error)
1.Try use one parameter with 4 dimension to pass txt filters, instead of 4 parameters
2.set filters on rec before pass Rec Varaible to function and pass only rec.0 -
Dear Kriki,
Thanks for your reply. I needed to know why this was not possible in Navision, because I could not find any information concerning the use of function calls as parameter. Also the Navision error did not help..
With seperate variables, all works fine, but this is also much code.
As a solution, I just used 4 times the setfilter code in eacht of my 3 functions, without the use of variables.
I see this as solved.
ThanksBohr-ing.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 329 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