Carriage Return into a text variable

LBR
Member Posts: 15
Hi,
I have a local variable MsgBody (text 260)
I like to insert some text into this variable to insert it on the body of a mail in two lines.
I've try this code
MsgBody := 'Course de : ' + Account + '\';
MsgBody := MsgBody + 'Remarque : ' + Remarques
But the result is (one line):
Course de : NBA\Remarque : non facturé
I've test '\\' and '/' and '//' but it's not the good combination.
Can you help me?
Thanks
Luc
I have a local variable MsgBody (text 260)
I like to insert some text into this variable to insert it on the body of a mail in two lines.
I've try this code
MsgBody := 'Course de : ' + Account + '\';
MsgBody := MsgBody + 'Remarque : ' + Remarques
But the result is (one line):
Course de : NBA\Remarque : non facturé
I've test '\\' and '/' and '//' but it's not the good combination.

Can you help me?
Thanks
Luc
0
Comments
-
You need a char 13 + char 10 for this, not the '\' character.
VAR chr13: Char chr10: Char CODE chr13 := 13; chr10 := 10; MsgBody := 'Course de : ' + Account + FORMAT(chr13) + FORMAT(chr10); MsgBody := MsgBody + 'Remarque : ' + Remarques;
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)1 -
Awesome! Exactly what I need! Thanks Luc.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
-
It's amazing what you can find on search these days.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
BTW Luc's solution doesn't quite work when sending e-mails with the new (from 5.0) Mail codeunit. Neither does a backslash (like in MESSAGEs) or \n or \r\n or really nothing.
What DOES help though is sending a HTML e-mail and inserting BR tags into it.0 -
Miklos Hollender wrote:BTW Luc's solution doesn't quite work when sending e-mails with the new (from 5.0) Mail codeunit. Neither does a backslash (like in MESSAGEs) or \n or \r\n or really nothing.
What DOES help though is sending a HTML e-mail and inserting BR tags into it.
This is not true. I used Luc's solution the with mail codeunit (400) in version 5.0 and the carriage return indeed works.
Let me know if you want to see what I did.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
What about checking for the existence of a carriage return.
VAR
chr13: Char
chr10: Char
CarriageReturn: Text(2)
CODE
chr13 := 13;
chr10 := 10;
MsgBody := 'Course de : ' + Account + FORMAT(chr13) + FORMAT(chr10);
MsgBody := MsgBody + 'Remarque : ' + Remarques;
CarriageReturn := FORMAT(chr13) + FORMAT(chr10);
IF STRPOS(MsgBody,CarriageReturn) <> 0 THEN
//do something, like maybe, replace CarriageReturn with '\'Jon Long - ArcherPoint
MCP - Dynamics NAV0 -
Miklos Hollender wrote:BTW Luc's solution doesn't quite work when sending e-mails with the new (from 5.0) Mail codeunit.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
It also depends on what you have set up as your default editor in Outlook, whether it's HTML based or not.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions