What is the use of 'message' field in client script??

rm3
Giga Contributor

Hi all, i am new to service now, just wanted to know what is the use of 'message' field in the Client script form. Please clarify this with a simple example if possible...

 

 

1 ACCEPTED SOLUTION

The messages can be anywhere used where messages are applicable. The example is an error message, you could also use this on the info message, alert, etc.. 

You will find the Messages if you navigate to "System UI > Messages".

Below the message from the above example:

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

13 REPLIES 13

Community Alums
Not applicable

@Mark Roethof

Thank you for your answer. I get a little bit confused that beside the messages field if you hover on the "?" you get the instruction mentioning  "one per line" as the image below. 

Follow you should we use the enter or line break ?

Thank you in advance !

 

find_real_file.png

Indeed, one per line, with separated with an enter.

An example from our environment:

find_real_file.png

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Community Alums
Not applicable

Thank you @Mark Roethof 

Martijn Odijk
Kilo Contributor

The content of the Message field is not required. If you use getMessage() in the code, it will get the correct Message from the sys_ui_message table and display that to the user even if the Message field is empty.

My guess is that it should still be used though: when a script is loaded from the server, I think that the messages are loaded with it; This prevents a server roundtrip when a message has to be displayed to the user, so it is good for performance.