Hi,
I'm trying to run a report from a codeunit started with Invoke-NAVCodeunit from PowerShell. But I get the following error:
Invoke-NAVCodeunit : Microsoft Dynamics NAV Management Server attempted to issue a client callback (Report - Chart of Accounts(1)). Client callbacks are not supported on Microsoft Dynamics NAV Management Server.
I can run the codeunit from the Development Environment and from the Job Queue without problems (The Chart of Accounts is printed). And when running from the Development Environment no Request Dialog was shown.
And if I choose a processing-only report, it also works from PowerShell.
My codeunit contains only one line of code:
REPORT.RUN(1, FALSE, FALSE);
I have also tried with the SystemPrinter parameter set to TRUE. And specifying the printer for the report in Printer Selections also did not solve the problem.
I have tried on both NAV 2013 R2 and NAV 2015 with the same result.
Are there anyone who have an idea of how I can make this work?
Best regards,
Lars
Comments
I believe report error is coming from "Printing" dialog. No matter you use "REPORT.RUN(1, FALSE, FALSE);" but windows auto showing the "Printing" dialog box. I didn't try on powershell to run report. I did test on WS and fail. But Navision 2015 is introduce new function Report.Print https://msdn.microsoft.com/en-us/library/dn762337%28v=nav.80%29.aspx. I did test with WS and work.
Hope this info help to you.
Regards,
Yukon
I may have to do some workaround using REPORT.SAVEASPDF, and then print the resulting file from PowerShell.
Regards,
Lars