Changing out-of-the-box Messages
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hi there,
Often topics on the Community fly by asking how to change certain text, on UI Pages, UI Macro's, Service Portal Widgets, etcetera. Most given answer: Edit the UI Page, clone the Service Portal Widget, etcetera. Though, why?!?! The magic word in most cases is simply:
UI Messages
Examples of (Out-of-the-box) messages
Below are five (5) common examples. Platform UI messages on UI Pages, Pages we cannot access, the Service Portal Virtual Agent widget.
UI Messages
Obviously, more artifacts could be thought off then the five (5) examples above. Though, in most situations the same principle applies:
- If developed well / Internationalization has been considered, then these Messages will be often setup with UI Messages. Or at least the support of UI Messages. For example through using gs.getMessage().
getMessage is not only used for Internationalization, making your instance Multi-Language. It can also be used to set up Messages in English language. Or… to override Messages!
Changing out-of-the-box Messages
For example, what if we would like to change the "Filter navigator" text from the first example?1) Navigate to the UI Messages (sys_ui_message table), "System UI > Messages"2) See if there is already a record with key "Filter navigator"- If you have one or more Language plugins installed, there will be records for that language
3) Change (if an English message already exists) or add (if no English message already exists) a record with below details:
Result
In the previous step, we've added a UI Message. The expected result should be that the "Filter navigator" text now displays "Your text". And… without scripting, changing UI Pages, cloning Service Portal widgets, etcetera.
The result:
Arguments
UI Messages can be made/setup more dynamically by using arguments. This could cause that you will not find all expected messages instantly. For example:
When looking for the exact text "I just checked and you have 1 Incident, 6 Requested Items and 92 Stories." as a key in the UI Messages, no result will be found. Actually, the yellow arched shaded text has been set up as an argument. The UI Message key actually looks like:
I just checked and you have {0} and {1}.
---
And that's it actually. Not much to it. Again, Editing UI Pages, cloning Service Portal widgets, etcetera: why?! Go for UI Messages instead.
Hope you like it. If any questions or remarks, let me know!
Kind regards,
Mark Roethof
ServiceNow Technical Consultant @ Paphos Group---
https://www.servicenow.com/community/developer-articles/changing-out-of-the-box-messages/ta-p/2310514
