HI everyone, I'm trying to create a txt file (nav 2016) with some data and for that I tried the "Hello World" example
So in the page action I added a button called TXT with the following code:
MESSAGE('WORD');
MyFile.CREATE( 'C:\teste.txt');
MyFile.CREATEOUTSTREAM(MyOutStream);
MyOutStream.WRITETEXT('Hello World!');
MyFile.CLOSE; // To end the writing and write out to the file.
MESSAGE('END WORD');
I read that nav stores the file in NAV server instead of client. How to download or save the file in the client ? I read about soem codeunits but I'm using Nav 2016 can i use that code? Below there's a example..
https://docs.microsoft.com/en-us/dynamics-nav/walkthrough--transferring-a-file-from-microsoft-dynamics-nav-server-to-the-client
how to use this in my context? Or are any other solutions ?
Answers
Archivo Var File
StreamOut Var OutStream
ClientFilePath Var Text
FileManagement Var CU419
ServerFileName:=FileManagement.ServerTempFileName('txt');
ClientFilePath:='C:\asdf.txt';
Archivo.CREATE(ServerFileName);
Archivo.CREATEOUTSTREAM(StreamOut);
StreamOut.WRITETEXT("Sales Shipment Line"."Document No.");
Archivo.CLOSE;
FileManagement.DownloadToFile(ServerFileName,ClientFilePath);
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!