Hi everyone,
While running the batch process i am getting “Target file must be in UNC format” error.
because this batch will create a file and will save the same in to the specified folder(path) which is entered by user.
The same process is working fine when i run normally(without selecting batch process).
can anyone tell me the solution for this.
Siva Mohan
Harish
January 31, 2012, 10:25am
2
Hi,
Is the batch process running in the server? If so, then most likely the server is not able to access the path. You can verify this by hard coding a path which is accessible to the server and then running the batch.
One option is instead of letting users specify the path, you can create a parameter field and store the path in this field. But first make sure server can access the path without any error.
Hi Harish,
Thanks for your reply…
I am working on Standalone system…
here is the code which i am using
as you said, i tried with hard coding. but it was not working and the same error message am getting.
can u suggest me where did i do mistake.
Thanks,
Siva Mohan Y
Hi Martin,
I gave the UNC path for file (fileName = @\SON15882\D$\Test\Cust.txt;) and i run the Batch Process.
but now i am getting the below error.
"Unable to open file \SON15882\D$\Test\Cust.txt **"**
can you please tell me that why it is coming and what will be solution?
Thanks
Siva Mohan
Harish
February 1, 2012, 10:05am
6
Hi,
If it is standalone system, provide the file path like this - ‘D:\Test\’.
Also use WinAPI function to check whether the path exists or not. See sample code below -
static void testFilePath(Args _args)
{
FilePath filePath;
FileIOPermission pathPermission;
;
filePath = ‘D:\Test’;
pathPermission = new FileIOPermission(filePath, ‘r’);
pathPermission.assert();
if (WinAPI::pathExists(filePath))
{
info (‘success’);
}
}
NOTE - you can also use pathExists method in winAPIServer class.
UNC path is the common path that should be shared by all the users in the company. Make sure that path is accessible to all the users.
What are usual problems with opening files?
The path is not correct (verify from the command line or so)
User has not enough rights (the user is the AOS service and I it really shouldn’t have access via administrative sharing (D$) - create a new shared folder and set appropriate rights for the AOS service)
The network access between those two machines does not work (many reasons)
Did you make it, to run reports in batch?
Seems like it’s not possible to run client side batch tasks on the server, without doing any customizations, from what I found here: https://community.dynamics.com/product/ax/f/33/p/28061/47837.aspx?wa=wsignin1.0
I’m using UNC format and user rights are ok, but I still get the error message ‘unable to open’.
Hi,
I am encountering the same problem. Though i have a proper UNC path the system is throwing an error
Target file must be in UNC format Error if the job is run as a batch.
Does any one has solution how to run a batch job to save reports in pdf format run as Job on Server ?. I am getting error at ReportRun.run() method.
Thanks