Hi All,
I have made a XML Port to import the txt file and calling it from a codeunit. The data is importing. I am facing the problem when I want to move the file from one folder to another. I am using the COPY command but it is giving me an error as : An I/O exception occurred during the operation.
Can anybody help me on this.
Thanks in advance.
Naman Upadhyay
Technical Consultant
0
Comments
Could you provide the code inside your codeunit?
If you try to move your file inside the Xmlport or when you go back in the codeunit, you get that kind of error because the file stream is still opened.
Nicolas Saleron
My code is as follows :-
File.TEXTMODE(TRUE);
File.WRITEMODE(FALSE);
File.OPEN(txtFileName);
File.CREATEINSTREAM(StreamIn);
XMLPORT.IMPORT(XMLPORT::"Import Sales Invoice", StreamIn);
File.CLOSE;
IF EXISTS(FromtxtFileName) THEN
BEGIN
COPY(FromtxtFileName,TotxtFileName);
END;
COPY is giving me this error.
Technical Consultant