Calling a function on a report

Hey, I have a report, where I have created a function I can call so I can set some global date variables. When I run it through the debugger, it’s calling the function to set the globals but when it runs the globals are cleared again…[:(!] Can anybody tell me, what I’m doing wrong. It’s on a 3.70 US database. This is the code: Cust.SETCURRENTKEY(Cust.“No.”); Cust.SETFILTER(Cust.“No.”,“Customer No.”); CustItemRep.SetParameters(StartDate,EndDate,StartCompDate,EndCompDate); CustItemRep.SETTABLEVIEW(Cust); CustItemRep.RUN;

Hi, This Code looks ok and should work perfectly. I am not sure how you are setting Global variables values in Report. Can you post the code which you have written in Report so we can give some concrete explanation/solution .

Perhaps you have a CLEARALL somewhere later in your code, or overwrite the variables in the OnPreReport trigger. Or do you use StartDate/EndDate to set a filter on Cust.“Date Filter” which then get’s overwritten by the SETTABLEVIEW… I am just guessing but you might post some more code of your report to identify the problem. Saludos Nils

Have you tried CustItemRep.SETTABLEVIEW(Cust); CustItemRep.SetParameters(StartDate,EndDate,StartCompDate,EndCompDate); CustItemRep.RUN; Who knows if the SETTABLEVIEW clears variables?