Translation Issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 05:43 AM
Hi,
I'm having trouble translating a message inside a Business Rule. I used gs.getMessage() along with the sys_ui_message table to store the translations, but the message is still not being translated in french.
this is my BR:
Thankx!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:18 AM
try this
If my re
var ritmGrp = new GlideRecord('sc_req_item');
ritmGrp.addQuery('sys_id', current.parent);
ritmGrp.query();
if (ritmGrp.next()) {
var reqMessage = gs.getMessageLang(
"Your request is waiting for approval by '{0}'", "fr",
[' ' + current.assignment_group.name + ' ' + ' (' + current.assignment_group.u_short_description + ')']
);
ritmGrp.comments.setJournalEntry(reqMessage);
}
sponse helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:35 AM
it worked for me using the sample script I shared
var ritmGrp = new GlideRecord('sc_req_item');
ritmGrp.addQuery('sys_id', current.parent);
ritmGrp.query();
if (ritmGrp.next()) {
// get the language of logged in user and then use it in below line
var myUserObject = gs.getUser();
var lang = myUserObject.getLanguage();
var reqMessage = gs.getMessageLang(
"Your request is waiting for approval by '{0}'", lang,
[' ' + current.assignment_group.name + ' ' + ' (' + current.assignment_group.u_short_description + ')']
);
ritmGrp.comments.setJournalEntry(reqMessage);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:56 AM
Still don't work !!!
BR:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 07:09 AM
you didn't use the function I shared and the exact script
use this
var ritmGrp = new GlideRecord('sc_req_item');
ritmGrp.addQuery('sys_id', current.parent);
ritmGrp.query();
if (ritmGrp.next()) {
// get the language of logged in user and then use it in below line
var myUserObject = gs.getUser();
var lang = myUserObject.getLanguage();
var reqMessage = gs.getMessageLang(
"Your request is waiting for approval by '{0}'", lang,
[' ' + current.assignment_group.name + ' ' + ' (' + current.assignment_group.u_short_description + ')']
);
ritmGrp.comments.setJournalEntry(reqMessage);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader