Even after having the access of Message table it is showing Key instead of Message from Scoped App

Jeet
Tera Expert

Adding the message to the top of form, I'm running a BR in scoped app which is returning the message code and using gs.getMessageLang('****') to show the exact message during update or insert.
But instead of Showing message it is showing only Message key.

4 REPLIES 4

Community Alums
Not applicable

Hi @Jeet ,

 

1. Message Exists in the Scoped App

Make sure the message key you're using is defined in the Messages table (sys_ui_message) within the same scope as your Business Rule.

  • Go to System UI > Messages
  • Filter by your scoped application
  • Make sure the message key exists and has a value

Scoped apps don’t automatically inherit global messages unless explicitly configured.


2. Use gs.getMessage() Instead of gs.getMessageLang()

In scoped apps, gs.getMessage() is usually sufficient and more reliable. Try replacing:

 

gs.getMessageLang('your_message_key');

 

with

gs.getMessage('your_message_key');

 

getMessageLang() is more specific and may not behave as expected in scoped apps unless localization is fully set up.


3. Check the Language Settings

If you're using getMessageLang(), make sure the language you're passing is supported and that the message has a translation for that language.

 

I have used specified parameter in the getMessageLang method the problem is its working on the DEV instance but not on the TEST instance other than that we didn't find this issue on the customer end.

 

DEV is on XANADU Patch 9

TEST is on YOKOHAMA Patch 4

 Its working when we are calling the message code those belongs to Global Scope from Scoped App. On other side its not fetching message if the message code resides on same scoped

 

I have checked for ACL permission for the user (Domain user) who is responsible for running the updates. BR's are getting executed but its only showing code on top of the form.

Ankur Bawiskar
Tera Patron
Tera Patron

@Jeet 

message is created in which scope?

you are calling it from which scope?

share some screenshots.

Since your BR is in scoped app and message might be in global scope, there could be cross scope issue?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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