how to use gs.getMessage() in scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2023 03:08 AM
how to use gs.getMessage() in scope?
Do we have an alternative?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2023 09:48 PM
Hi @Meloper ,
Recommended way to use getMessage() is
var message = gs.getMessage("This is the message with params {0}", param);
gs.addInfoMessage(message);
Alternately, it can also be written as
var message = "This is the message with params {0}";
gs.addInfoMessage(gs.getMessage(message,param));
and it works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2023 11:26 PM
Hi @Meloper
Go through this link for more information on getMessage
https://www.servicenow.com/community/in-other-news/gs-getmessage-the-second-parameter/ba-p/2279603
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2023 01:23 AM
Hi,
The method gs.getMessage() works in both Global scope, and in Scoped Apps.
You can read more on the Developer site.
Do note that you will need to execute the operation once in order to set up the cross scope privileges needed.
What issue are you facing?