web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Reading outStream Object

(0) ShareShare
ReportReport
Posted on by

Hi, How can i convert outStream object to Text in Business Central Wave 2 ? 
previously i was doing this; 

tempBlob.Init();
TempBlob.Blob.CreateOutStream(Ostream);
Xmlport.Export(70112320, Ostream, glAccount);
StreamText := tempblob.ToBase64String();
exit(StreamText);

how can I achieve this in wave 2 ?

I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    Use codeunit "Base64 Convert" to convert to base64.

    Ex : ReturnValue := Base64Convert.ToBase64(stream);

  • Faran Mahboob Profile Picture
    on at

    ToBase64 method accepts text as parameter, how to convert stream into text in wave 2 ?

  • Suggested answer
    Viki NTS Profile Picture
    250 on at

    Hi,

    function ToBase64String moved to 4110 "Base64 Convert"  codeunit and it has following overloading methods.

    ToBase64(String: Text): Text

    ToBase64(String: Text; InsertLineBreaks: Boolean): Text 

    ToBase64(InStream: InStream): Text

    ToBase64(InStream: InStream; InsertLineBreaks: Boolean): Text 

    Create variable for the Codeunit and pass stream as argument into ToBase64String function

    for more business central breaking changes follow below link and see Base64 Convert Module

    https://github.com/microsoft/ALAppExtensions/blob/master/BREAKINGCHANGES.md#base64-convert-module

     Note : make sure you are using right symbols. get latest docker container of Business Central Release Wave 2 and download symbols again with BaseApp and SystemApp Dependencies 

  • Faran Mahboob Profile Picture
    on at

    thanks Vigneswaran, Is there any way to pass OutStream object to ToBase64 method, it accepts InStream but not OutStream object?

  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    Just create instream from your tempblob and pass it to Base64 Convert codeunit.

    TempBlob.CreateInStream(InStream);

  • Faran Mahboob Profile Picture
    on at

    thank you Teddy HI managed to solve it this way. 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans