- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 08:54 PM
Hi everyone
I am wondering how exactly the gs.getMessage get the message in Message table(sys_ui_message) .
for example, I have four record with the same key as 'request' ,Application with Global are OOB.
Now if I use
function getFilterName(table) {
if (table == 'sc_cat_item')
return gs.getMessage("Request");
what will return ??????? As my test, nothing changed still 'request' returned, I want know how the gs.getMessage work when the same key record exist in the table.
And where can I find the source code of the gs.getMessage fuction??
help me please, thanks!
Solved! Go to Solution.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 11:32 PM
Hi Bai,
a. Go to "Messages" table
b. Filter for a key that has multiple messages ("Request" in your example)
c. Add columns "Key", "Message", and "Update name" in the list view
d. Sort the list in ascending order by "Update name"
The one you see at the top is the message that will be displayed.
I hadn't explored this before but ran a few tests today to identify the pattern and this seemed consistent.
On a related note, I would refrain from adding multiple messages for the same key in the same language.
Thanks,
Arav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 11:32 PM
Hi Bai,
a. Go to "Messages" table
b. Filter for a key that has multiple messages ("Request" in your example)
c. Add columns "Key", "Message", and "Update name" in the list view
d. Sort the list in ascending order by "Update name"
The one you see at the top is the message that will be displayed.
I hadn't explored this before but ran a few tests today to identify the pattern and this seemed consistent.
On a related note, I would refrain from adding multiple messages for the same key in the same language.
Thanks,
Arav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2022 02:55 AM
Bai,
Ok so there's a few things to unpack here,
When calling the Message API, the system will first check the [sys_ui_message] table to see if there is an entry in the table to match that key specifically for that session language of the call (getMessageLang is where you want to force a specific language but the return is the same principle). If there is no record to match a key and language against, it will simply return what was sent to it.
If for what-ever reason you have more than one record with the same key in the same language, it will return the first it sees (which could be based on many factors, such as table indexes, cache's etc), therefore it is best practice to only have 1 key per language - as a side note the key is case insensitive,
If you would like to learn more about the translation tables, please check my blog post on them here, alternatively if you'd like to learn more about the topic as a whole, we have a dedicated forum here where I post various technical deep-dives in my blog,
Many thanks,
kind regards
Director of Globalization Deployment, Internationalization