Skip to main content

Notifications

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 ?

  • Faran Mahboob Profile Picture
    on at
    RE: Reading outStream Object

    thank you Teddy HI managed to solve it this way. 

  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    13,637 Moderator on at
    RE: Reading outStream Object

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

    TempBlob.CreateInStream(InStream);

  • Faran Mahboob Profile Picture
    on at
    RE: Reading outStream Object

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

  • Suggested answer
    Viki NTS Profile Picture
    250 on at
    RE: Reading outStream Object

    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
    RE: Reading outStream Object

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

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    13,637 Moderator on at
    RE: Reading outStream Object

    Use codeunit "Base64 Convert" to convert to base64.

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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 807

#2
YUN ZHU Profile Picture

YUN ZHU 764 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 529

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans