I am importing csv file from a dataport and then copy the file to a different folder.
It imports correctly but the file is empty.
I don't know why the file is empty after import. ](*,)
text constants:
Text0001-> %1 Orders Imported / Would You Like To Delete The File?
FilePath->c:\DataportFile\Completed Import\
OnPostDataport()
CurrFile.CLOSE; //don't forget to close!
IF CONFIRM(Text0001,TRUE,OrderCount) THEN BEGIN
SavedFileName := FORMAT(WORKDATE,0,'<Year4>'+'-'+'<Month Text,3>'+'-'+'<Day,2>')+'.txt';
FILE.COPY(CurrDataport.FILENAME,FilePath+SavedFileName);
ERASE(CurrDataport.FILENAME);
END;
In this example of moving a file after import to another directory - my new filename becomes the day month year.
And then in code unit itself I move the file to new location
IF COPY("Imp Ready to Process Location" + '\' + ImpFile.Name,"Imp Processed Location" + '\' + ImpFile.Name) THEN ERASE("Imp Ready to Process Location" + '\' + ImpFile.Name);
Comments
text constants:
Text0001-> %1 Orders Imported / Would You Like To Delete The File?
FilePath->c:\DataportFile\Completed Import\
OnPostDataport()
In this example of moving a file after import to another directory - my new filename becomes the day month year.
http://www.BiloBeauty.com
http://www.autismspeaks.org
GLEAdjImport.IMPORT := TRUE;
GLEAdjImport.FILENAME := ImpFile.Path + '\' + ImpFile.Name;
GLEAdjImport.RUN;
And then in code unit itself I move the file to new location
IF COPY("Imp Ready to Process Location" + '\' + ImpFile.Name,"Imp Processed Location" + '\' + ImpFile.Name) THEN
ERASE("Imp Ready to Process Location" + '\' + ImpFile.Name);
have you tried closing the file before moving it?
http://www.BiloBeauty.com
http://www.autismspeaks.org
My money is on this
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
are you obligated to move the file using the codeunit?
http://www.BiloBeauty.com
http://www.autismspeaks.org