You can define a function in Your report (e.g. SetPars), and send the values You need into this function as parameters.
Then in the function You can assign the parameter-values to Global Variables defined in the report.
You can also look into using SETTABLEVIEW, if what You actually want to do, is to be able to find a specific record, once inside Your report.
In Purchase Orders → Purchase Order Subform i made function like this : TESTFIELD(Type,Type::Item); BEGIN BarcodeSN.RESET; BarcodeSN.SETRANGE(“Document No.”,“Document No.”); BarcodeSN.SETRANGE(“Item No.”,“No.”); REPORT.RUNMODAL(REPORT::“Inserting SN Barcode”,TRUE); END; all that i want is that Document No. could be fill in the DocNo Variable in Report “Inserting SN Barcode” By The Way, I Have tried your code I made a function called SetPar and then I save it (compiled) setPar(parDocNo : Code[20]) DocNo := parDocNo but it didn’t work and restart my navision application
maybe you didn’t follow Teddy’s advice correctly. This technique may be tricky to understand at first - I also had troubles with it.
SetPar is intended to be a function in the report. It receives the local variable parDocNo and assigns it to global variable which will be available to the whole report.
When you call the report from your form, you must define it as variable and access it (the report) through that.
Please take notice: not “REPORT.RUNMODAL(REPORT::“Inserting SN Barcode”,TRUE)” this would call a different instance of the abovesaid report and the variables in it would be initialized.