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?
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.
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;
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.
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.
Hi,
Can you try below?
trigger OnAction()
var
newLable: Label 'This is multiline \ Text availabe in BC';
begin
Message(newLable);
end;
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:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156