Triggering a system message to show on a pop-up in UI Action

labandar
Tera Contributor

Hello ServiceNow Devs,
I'm trying to get a message into Workspace Client script of UI Action as in the screen shot below to show in a pop-up in SOW but I'm getting the key instead if the message when I change the language, if I try to trigger again I'm Getting the message in the respective language. Any idea how to over come this?

Here is the code I've used.

labandar_3-1735913876306.png

 


Here are the screen shots of what's happening:
Tried it in Portuguese language, initially I'm getting it in English and then if I close the dialogue button and click again then it is showing in Portuguese

first time click

labandar_1-1735913702371.png


Second Time click

 

labandar_2-1735913799698.png

 



6 REPLIES 6

@labandar 

then it's not working as expected in native view?

If yes the script etc is fine, please raise a HI ticket

Can you share the steps to reproduce so that I can also check in my instance?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar  Actually for native view it is different, I can guide you here for SOW.
Go to 'sys_declarative_action_assignment' and find the request approval button of the Change Management for SOW. 
Add the following code:

var popUp = getMessage('Please ensure the risk calculation has been completed.');
       g_modal.showFields({
        title: popUp,
        size: 'lg'
    });
Now go to sys_ui_message table, create a new message - 'Please ensure the risk calculation has been completed.' with different languages. 

After completing the above go to SOW create a new change record and click on request approval