issue with getMessage() in On change client script

Brijmohan
Tera Contributor

Hi All,

 

I am not able to get translated data from sys_ui_message table.

I am creating a on change client script and showing a field error message but it only displaying in English even though I am impersonated with Chinese user. 

PFB setup that I did.

 

Client script getMessage entry -

 g_form.showFieldMsg('u_legal_entity_country', getMessage('Recordproduceraccess'), 'error');

 

Message field on client script-

 

Brijmohan_1-1687947905110.png

 

sys_ui_message table entry - 

Brijmohan_2-1687947951153.png

 

Thanks,

Brij

1 ACCEPTED SOLUTION

@Riya Verma,
No it's ok, server-side is "gs.getMessage()" and client-side is indeed "getMessage()",

@Brijmohan,
You may have to do a "cache.do" to force your browser to download the string incase you've viewed that message before the translation record was made,

Also it's worth asking, does the English message show as intended?

Failing that, double check that the key in Chinese doesn't accidentally have a trailing space and so isn't making an explicit match,

Many thanks,
Kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization

View solution in original post

3 REPLIES 3

Riya Verma
Kilo Sage
Kilo Sage

Hi @Brijmohan ,

Hope you are doing great.

 

Glide System is server side api and its not best practice to use Glide System API in client script. getMessage is funtion of glide system api and it's a server side API.

 
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma

@Riya Verma,
No it's ok, server-side is "gs.getMessage()" and client-side is indeed "getMessage()",

@Brijmohan,
You may have to do a "cache.do" to force your browser to download the string incase you've viewed that message before the translation record was made,

Also it's worth asking, does the English message show as intended?

Failing that, double check that the key in Chinese doesn't accidentally have a trailing space and so isn't making an explicit match,

Many thanks,
Kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization

Hi @Alex Coope - SN , Thanks for you suggestion. There was a cache issue. It is working now.

 

Regards,

Brij