Catalog client script problem using getMessage for Service Portal

kuarq
Mega Contributor

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.

find_real_file.png

find_real_file.png

 

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

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

View solution in original post

6 REPLIES 6

Hello,

I flushed the instance cache and it worked.

I changed my message key and I was finding weird the alert was still displaying the old key.

Thank you for your help.

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn