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...
Answered

how to create memo field with al

(0) ShareShare
ReportReport
Posted on by 35

I need to create text field in my item table. I searched a lot an I found something thats looks like : https://community.dynamics.com/nav/b/smallsquareservices/posts/using-memo-blob-to-enable-huge-text.

But it's an old one and there was breaking changes since release 15.

Can someone help me ?

Thanks 

Patrick

  • Suggested answer
    Chris Bulson Profile Picture
    Microsoft Employee on at

    Hello,

    It looks like the same idea applies in AL (Memo for Blob data type)

    docs.microsoft.com/.../blob-data-type

    I can't provide any sample code, although someone from the community may be able to do that.

  • Verified answer
    ptournay Profile Picture
    35 on at

    Thanks for your help.

    As it was very urgent, I tried many things and finally I found a solution  which is valid in version 15 and above.

    I hope it will help someone else.

    Patrick

    1) In the table ext : create a blob

      field(55093; Avantages; Blob)
            {
                Subtype = Memo;
                Caption = 'Avantages';
                DataClassification = ToBeClassified;
            }
    2) in the table ext create 2 procedures
    Those procedures will make the data exchange between the Text field on screen and the blob field in database
     PROCEDURE SetAvantages(NewText: Text);
        VAR
            OutStr: OutStream;
        BEGIN
            CLEAR(Avantages);
            IF NewText = '' THEN
                EXIT;
            Avantages.CreateOutStream(OutStr);
            OutStr.WriteText(NewText);
            MODIFY;
        END;

        PROCEDURE GetAvantages(): Text;
        VAR
            InStr: InStream;
            outText: Text;
        BEGIN
            CALCFIELDS(Avantages);
            IF NOT Avantages.HASVALUE THEN
                EXIT('');
            Avantages.CreateInStream(InStr);
            InStr.ReadText(outText);
            EXIT(outText);
        END;
    3) in the page ext : create a TEXT variable
    at the bottom
     var
            AvantagesText: Text;
    4) in the page ext : create a TEXT field
    field(AvantagesText; AvantagesText) <= the variable create in (3)
                    {
                        Caption = 'Avantages';
                        ApplicationArea = All;
                        Editable = true;
                        MultiLine = true;
                        trigger OnValidate()
                        begin
                            SetAvantages(AvantagesText);
                        end;
                    }
    5) in the page ext : add a trigger for filling text variable with bob content on reading
    trigger OnAfterGetRecord()
        begin
            AvantagesText := GetAvantages();
        end;

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 633 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 419 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 236 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans