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

Print message in multiple line

(0) ShareShare
ReportReport
Posted on by 1,455

Dear folks,

I have come across a situation where I want to print the data in the multiple lines. I have created a field in the Customer card where I have enabled the MultiLine property to enter the data into multiple lines.

Till here it looks fine, but the same when I print from the sales order page, the message shows in single line. 

How can I resolve it?

pastedimage1678866936842v1.png

pastedimage1678866952963v2.png

trigger OnOpenPage()
var
    Customer: Record Customer;
begin
    if Rec."Sell-to Customer No." = '' then
        exit;
    Customer.get(Rec."Sell-to Customer No.");
    if Customer."Customer Message" = '' then
        exit;
    Message(Customer."Customer Message");
end;

PS: I have tried using "\\" also, but it did not work.

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    Instead of using a message box you could look into using a standard dialog page instead with a multiline text box.

    There is a nice video on dialogs in Business Central here:

    www.youtube.com/watch

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

    Hi,

    Can you try below?

    trigger OnAction()

                       var

                           newLable: Label 'This is multiline \ Text availabe in BC';

                       begin

                           Message(newLable);

                       end;

    pastedimage1678868789378v1.png

  • Avinash B Profile Picture
    1,455 on at

    Hi Inge,

    Thanks for the suggestion. But there are certain limitations using it.  

    1. It shows the  "Working on it...." which I don't want.

    2. It closes automatically. Sometimes we can not read the message also.

    So it won't fulfil my requirement.

  • Avinash B Profile Picture
    1,455 on at

    Hello Nitin,

    Thanks for the suggestion. It works fine if it is a label. But I can not keep the message same because it depends on Customer master.

    I also tried to replace the character (LF or CTLF) from the text to "\\". But it didn't work that way too.

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    Thanks all for the suggestions.

    It worked with this code..

    internal procedure ShowCustomerComment()
    var
        Customer: Record Customer;
        TypeHelper: Codeunit "Type Helper";
        CustomerMessages: List of [Text];
        MessageTxt, CustomerMessage : Text;
    begin
        if Rec."Sell-to Customer No." = '' then
            exit;
        Customer.get(Rec."Sell-to Customer No.");
        if Customer."Customer Message" = '' then
            exit;
        CustomerMessages := Customer."Customer Message".Split(TypeHelper.LFSeparator());
        foreach CustomerMessage in CustomerMessages do
            MessageTxt  = '\'   CustomerMessage;
        Message(MessageTxt);
    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

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 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans