- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:23 AM - edited 03-20-2024 05:25 AM
Hello, wondering if I could get some help if someone's had this issue before.
I intend to use table sys_ui_message (messages) in order to add some field messages in a client script. The only downside is that I cant add any line breaks. I can do this all in the client script which isnt an issue using '\n' however I don't want to make it clunky.
For example in the message if I type,
My name is Dave.
I like to go hiking.
The field message shows as.
My name is dave. I like to go hiking.
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 08:15 AM
Hi, I found the answer and it’s a limitation of field messages, unfortunately you can’t add line breaks, even if you do it all in the script \n just doesn’t work. Not a problem though I’ve just had to separate it into 2 messages.
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:33 AM
Hi @Andrew_TND ,
Please try
var message = gs.getMessage('Your_Message_Key');
// Add line breaks at appropriate positions
var formattedMessage = message.replace(/\. /g, '.\n');
Please mark it as helpful. If the solution is fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:37 AM
Hi @Arun_Manoj
gs. wont work in client scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:41 AM
Hi @Andrew_TND ,
try to get Invoke GlideAjax from Client Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 08:15 AM
Hi, I found the answer and it’s a limitation of field messages, unfortunately you can’t add line breaks, even if you do it all in the script \n just doesn’t work. Not a problem though I’ve just had to separate it into 2 messages.
Thanks for your help.