Target file must be in UNC format Error

Hi All,

I have a task to create pdf files from a ax report as a batch job (Server) that runs every two hours daily. I am able to run the batch class as a menu item with out any problem. but when i scheduled the same job as a batch i am getting an error Target file must be in UNC format Error exactly at reportRun.run() function. i Hard coded the UNC path \serverName\shareName\sample.pdf but still throwing an error. Does any one have run the server batch jobs to create pdf files and save into netwok shared folder.

Code :

args.record(fiscalDocJour_rpt);

args.caller(reportRun);

reportRun = new reportRun(args);

reportRun.query().interactive(false);

reportRun.report().interactive(false);

// reportRun.setTarget(printMedium::File);

reportRun.printJobSettings().setTarget(PrintMedium::File);

reportRun.printJobSettings().preferredTarget(PrintMedium::File);

reportRun.printJobSettings().format(PrintFormat::PDF);

reportRun.printJobSettings().doNotOverwrite(false);

reportRun.printJobSettings().warnIfFileExists(false);

reportRun.printJobSettings().suppressScalingMessage(true);

reportRun.printJobSettings().lockDestinationProperties(true);

reportRun.printJobSettings().fileName(@"\tstMachine\SharedFolder\SAMPLE.PDF");

reportRun.init();

reportRun.run();

Thanks in advance,

Which version of AX is it about? Are you sure that the folder exists, the name isn’t already taken and the AOS service account has permissions to write there?