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

Set a default value for the new field type text across the page.

(0) ShareShare
ReportReport
Posted on by 12

Hi

I tried to customize a page by adding a new field with a default value.

How can I do this?

Screenshot-_2800_84_2900_.png

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.

    How to set the initial value (Automatically set default value for field)

    https://yzhums.com/11876/

    Thanks.

    ZHU

  • Suggested answer
    Lama Khaled Profile Picture
    12 on at

    Hello Mr.ZHU

    Thanks for all your effort when you help us, always you write the best result.

    I have really used the InitValue property but it's not used with the BLOB datatype field.

    It's correct with the Text datatype field but the problem with the Text field is the size of the box to write on it is very small, I need a more large box to write as Blob field " like work description ".

    How I can set default data on the BLOB field? or another way to make the box to write on the Text field larger?

    I wish you can help me!

  • Suggested answer
    YUN ZHU Profile Picture
    95,595 Super User 2025 Season 2 on at

    Hi, the initial value of the BLOB field can only be done using code. As for the method, you can refer to procedure SetWorkDescription in Sales Header.

    Hope this helps.

    Thanks.

    ZHU

  • Lama Khaled Profile Picture
    12 on at

    Thanks

    How I can use this method?

  • Verified answer
    YUN ZHU Profile Picture
    95,595 Super User 2025 Season 2 on at

    For example,

  • Lama Khaled Profile Picture
    12 on at

    Thanks so much for the best useful answer.

  • Lama Khaled Profile Picture
    12 on at

    How I can write more than one line in the Work Description text box by this trigger code?

    I have used this character to make a new line '' but it's not useful.

  • Suggested answer
    YUN ZHU Profile Picture
    95,595 Super User 2025 Season 2 on at

    Hi, very interesting question. Try the code below.

    tableextension 50111 MyExtension extends "Sales Header"
    {
        trigger OnInsert()
        var
            TypeHelper: Codeunit "Type Helper";
            Crlf: Text[2];
            String: Text[2048];
            OutS: OutStream;
        begin
            Crlf := TypeHelper.CRLFSeparator();
            String := 'This is line 1'   Crlf   'This is line 2'   Crlf   'This is line 3';
            Clear("Work Description");
            "Work Description".CreateOutStream(OutS, TextEncoding::UTF8);
            //OutS.WriteText(textstring);
            OutS.Write(String);
        end;
    }

  • Lama Khaled Profile Picture
    12 on at

    Perfect, Thanks a lot.

  • Suggested answer
    abhaq5000 Profile Picture
    15 on at

    YUN ZHU

    very good

    Good Job Man

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