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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to read blob file in nav

(1) ShareShare
ReportReport
Posted on by 133

Can you please check where i am wrong

TemplateTable.CALCFIELDS(ImportTemp);
IF TemplateTable.GET('141') THEN
TempBlob.Blob.CREATEINSTREAM(Ins);
WHILE NOT Ins.EOS DO BEGIN
Ins.READTEXT(EmailTemplateBody);
MESSAGE('%1',EmailTemplateBody);
END;

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,231 Super User 2026 Season 1 on at

    Hi, hope the following helps.

    pastedimage1686268342493v1.png

    pastedimage1686268347418v2.png

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,788 Moderator on at

    Hi,

    You can have an idea by going to Sales Header Table and find the function to get and set work description.

       procedure SetWorkDescription(NewWorkDescription: Text)
        var
            OutStream: OutStream;
        begin
            Clear("Work Description");
            "Work Description".CreateOutStream(OutStream, TEXTENCODING::UTF8);
            OutStream.WriteText(NewWorkDescription);
            Modify();
        end;
    
        procedure GetWorkDescription() WorkDescription: Text
        var
            TypeHelper: Codeunit "Type Helper";
            InStream: InStream;
        begin
            CalcFields("Work Description");
            "Work Description".CreateInStream(InStream, TEXTENCODING::UTF8);
            exit(TypeHelper.TryReadAsTextWithSepAndFieldErrMsg(InStream, TypeHelper.LFSeparator(), FieldName("Work Description")));
        end;

  • AjayPandey Profile Picture
    133 on at

    I want to read  HTML templates which i have already import in templates table and i want to  use this templates in email to customers

    mention below are the codes for import templates.


    ImportTemplate - OnAction()
    Rec.CALCFIELDS(ImportTemp);
    IF Rec.ImportTemp.HASVALUE THEN
    MESSAGE('Template is alredy Uploaded');
    IF NOT CONFIRM('Do you want to ReUpload?') THEN
    EXIT;

    FileName := Filemgm.BLOBImportWithFilter(TempBlob, 'Upload File', '', 'All Files (*.*)|*.HTML*', '.HTML');
    TempBlob.Blob.CREATEINSTREAM(Ins);
    Rec.ImportTemp.CREATEOUTSTREAM(Outs);
    COPYSTREAM(Outs, Ins);
    IF TempBlob.Length()>5000000 THEN
    ERROR('File size must be less than or equal to 3MB')
    ELSE BEGIN
    Rec.MODIFY(TRUE);
    MESSAGE('File Uploaded');
    END;

    ExportTemplate - OnAction()
    Rec.CALCFIELDS(ImportTemp);
    Rec.ImportTemp.CREATEINSTREAM(Ins);
    TempBlob.Blob.CREATEOUTSTREAM(Outs);
    COPYSTREAM(Outs,Ins);
    IF Rec.ImportTemp.HASVALUE THEN
    FilemngCU.BLOBExport(TempBlob, FileName + 'Parcel.html', TRUE)
    ELSE
    ERROR('File Not found');

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,960 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,084 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,047 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans