How generate file txt in Navision?

Hi, good afternoon

I am new in the world navision and I have question's

My buddie has me asked creating a file txt from navision but the example shared is a txt with algoritm

what is the most recommended way to do this process?

best regards,

Javier.

Best Answer

  • javierseijasjavierseijas Member Posts: 4
    Answer ✓
    Hi,

    I have solved this issue, for this I have written this code, in case someone is interested

    FileName := 'C:\MyRuta\MyFile.txt';
    CLEAR (OUTFILE);
    OutFile.TEXTMODE := TRUE;
    OutFile.WRITEMODE := TRUE;
    OutFile.CREATE (FileName);
    OutFile.CREATEOUTSTREAM(OutFileStream);
    OutFile.CLOSE;
    FileManagement.DownloadToFile(FileName,FileName);

    he declares the local variables to be able to instantiate them in the code;
    FileName with a DataType: text, OutFile with a DataType: File, OutFileStream with a DataType: OutStream and FileManagement with a DataType: Codeunit and select FileManagement.





Answers

  • txerifftxeriff Member Posts: 501
    Hi,

    you should do a xmlport, it allows also to create CSV files.(format=variable text). is that what you are looking for?

  • javierseijasjavierseijas Member Posts: 4
    Answer ✓
    Hi,

    I have solved this issue, for this I have written this code, in case someone is interested

    FileName := 'C:\MyRuta\MyFile.txt';
    CLEAR (OUTFILE);
    OutFile.TEXTMODE := TRUE;
    OutFile.WRITEMODE := TRUE;
    OutFile.CREATE (FileName);
    OutFile.CREATEOUTSTREAM(OutFileStream);
    OutFile.CLOSE;
    FileManagement.DownloadToFile(FileName,FileName);

    he declares the local variables to be able to instantiate them in the code;
    FileName with a DataType: text, OutFile with a DataType: File, OutFileStream with a DataType: OutStream and FileManagement with a DataType: Codeunit and select FileManagement.





Sign In or Register to comment.