Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

How to apply StreamWriter and Text Encoding in NAV2009?

Posted on by Microsoft Employee

In 2016,

We have DOTNET Variable for the StreamWriter and Text Encoding  like below

outFile.CREATE('c:\temp\OutFile.txt');

  outFile.CREATEOUTSTREAM(outStream);

  streamWriter := streamWriter.StreamWriter(outStream, encoding.Unicode);

 

  streamWriter.WriteLine('Hello World');

 

  streamWriter.Close();

  outFile.CLOSE();

But do apply the same in NAV2009?

Please Help....

*This post is locked for comments

  • Othman Abo Salah Profile Picture
    Othman Abo Salah 70 on at
    RE: How to apply StreamWriter and Text Encoding in NAV2009?

    You can't apply the same as long as the Unicode parameter had been added from nav 2013 R2 and efter

  • Suggested answer
    Rehan Satti Profile Picture
    Rehan Satti 634 on at
    RE: How to apply StreamWriter and Text Encoding in NAV2009?

    Hi, you can use following way to write some thing in file. For communication with webservices you can use automation variable given in NAV 2009.

    logfile.WriteMode := true;

    logfile.OPEN('Currency_log_file.log');

    logfile.POS(logfile.LEN); //set position in file to the end

    logfile.Write(...);

    logfile.Close;

    DotNet & stream types are available in dynamics NAV 2009 R2.

    Have a look !

    7853.3.PNG

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: How to apply StreamWriter and Text Encoding in NAV2009?

    In NAV 2009 we do not have dotnet datatype...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans