Hi Friends,
My requirement: By clicking a new command button in Posted Invoice form, I must run a dataport followed by running an exe file.
I did a code in dataport (Dataport - OnPreDataport trigger) which stores the text file in specified folder ...
CurrDataport.FILENAME := 'C:\ARG\EInvoice\' + FORMAT(WORKDATE,0, 'Invoice' + '.txt' ;
... and I wrote in newly created command button's (On Push() trigger) ...
DATAPORT.RUN(DATAPORT::"<Name of the dataport to run>"); // To run a dataport
SHELL('C:\Program Files\Windows NT\Accessories\wordpad.exe'); // To run the exe file - just for an example
C:\Program Files\Windows NT\Accessories\wordpad.exe : is a sample path...
While running the dataport, it should filter to the current record and store in a specific folder. Then after few milliseconds the exe file should get triggered (which uses the extracted data through dataport from the folder - no need to worry about this function.).
Can anyone tell me how to achieve this?
Thanks,
Aravindh.
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
DATAPORT.RUN(DATAPORT::"<Name of the dataport to run>",FALSE,recCurrentRecord);
are you sure to use RUN not RUNMODAL... ?
Aravindh.
if you have a single instance codeunit, you can let the dataport modify a boolean in the cu so the exe can start. Or you can keep scanning the folder every few milliseconds for files that are editable. If found then you can run them.
Make sure that the code that's running waiting for the dataport to be finished won't lockup your NAV.
|To-Increase|