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...
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
    95,595 Super User 2025 Season 2 on at

    Hi, hope the following helps.

    pastedimage1686268342493v1.png

    pastedimage1686268347418v2.png

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 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

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,010

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans