getMessage on Service Portal

peterraeves
Mega Guru

For some reason SN stopped supporting the getMessage function on the mobile or SP interface... So what's the equivalent to do this? They must have some function to do some translations on SP in client scripts, right?

Client script on record producer:

Image 8.png

Messages:

Image 99.png

When I click 'try it' on record producer, I get:

Image 5.png

When I go to portal, I get:

Image 6.png

With error message:

Image 7.png

9 REPLIES 9

Gaurav Bajaj
Kilo Sage

HI Peter,



Did you try with ${}



I am not sure how this will behave in a client script but its worth a shot.


find_real_file.png



https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/build/service-portal/concept/c_W...




Please mark correct/helpful based on the impact of the response.




Thanks


Gaurav


gs is only available on the server-side


peterraeves
Mega Guru

I found the solution here: Service Portal and client scripts. Basically getMessage has a second parameter client side, a callback function... Just like GlideRecord.query or GlideRecord.get... I should have known...



I changed my code to:



Image 10.png



And now it works



Image 11.png


Nice to know that