I am trying to do a setup to run dataports on Job Scheduler. We added a file path for each job so the dataport request form doesn't need to be shown.
Does any one know if I have to change the dataport to make the UseReqForm set to false? I know this will work. And Looks like it can't be changed by the code. But the customer also like to manually run the dataport in the mean time. So now looks like I have to make a copy of each dataport for running it manually.
Any suggestion will be appreciated.
0
Comments
You could create a codeunit ( or report ) to run the dataports in the job scheduler and use
dataport.run( number, false );
Where number is the dataport number and false turns off the request form
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
But this way I couldn't pass through the file path in there. The idea is to set the path outside of the codeunit.
I did a report to run through all the scheduler and read all the files under the path use file table.
ImpFile.RESET;
ImpFile.SETFILTER(Path,DELCHR(FilePath,'>','\'));
ImpFile.SETRANGE("Is a file", TRUE);
dptImp.FILENAME := ImpFile.Path + '\' + ImpFile.Name;
dptImp.RUNMODAL;
You can solve this by using the
dataport.run( number, false );
and then in the dataport in the onpredataport trigger put
and lookup the filename as you were doing.
This will allow the user to run manually and select their own file.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
And if I add the file table loop to the dataport, I need to do it for maybe 10 dataports. And I am not sure if it will work for manually running. e.g. select single file.
Then another suggestion - generate output to a fixed filename/path and rename it when dataport is finished
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!