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 ?

  • RE: Reading outStream Object

    thank you Teddy HI managed to solve it this way. 

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

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

    TempBlob.CreateInStream(InStream);

  • 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
    Viki NTS 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 

  • 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
    Teddy Herryanto (Th... 13,025 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 Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans