- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2020 12:42 PM
Hello,
I have an onSubmit Catalog client script and within I'm using an alert and the getMessage to automatically get a message key for translation purpose. The script has to work on all interfaces (UI type = ALL).
On the Service Portal the problem I have is that the first time the alert pops, the message key and not the actual message. On the second attempt, then the actual message is displayed.
I found some posts regarding this problem but it was for Helsinki and we are on New York.
Here is the code portion I'm using to get the message
var passed = forceMandatoryCheckboxes(mandatoryVars, mandatoryCount);
if(!passed){
//Abort the submit
alert(getMessage('select_location_access_card'));
return false;
Is this still a bug or maybe I'm not using the correct code for the Portal?
Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2020 12:45 PM
I've also described this a few months ago in this article:
Catalog Client Script Messages (Internationalization/Multi-Language)
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2020 12:44 PM
Please find solution the below thread :-
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2020 12:44 PM
Hi there,
Did you add the message to the message field? Out-of-the-box the message field is not on the form lay-out of Catalog Client Scripts.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 07:44 AM
Hello,
I tried your solution. I added the 'Messages, field on the form and inside I typed my message key.
It works fin but only when I'm in English. If I try it in French I have the same problem, the first time the alert pops it displays the message key.
I also tried another solution using the callback function and same result, English works but not French.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 08:02 AM
Can you share exactly what you've set up? Catalog Client Script + UI Messages).
Asking this because we use a multi-language instance also (English and Dutch), and this works fine.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
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