// 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"), '', '', '');
Answers
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.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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.
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.
Thanks