Skip Navigation
Expand
MessageBase ROQL on LabelName not working in Customer Portal
Answer ID 11421   |   Last Review Date 04/02/2021

Why am I unable to use LabelName to query MessageBase?

Environment:

Customer Portal (CP)

Resolution:

When querying MessageBase using a Widget or a custom Script, call them with an ID.

Cause:

MessageBase names are replaced with the ID value when they are optimized for use. MessageBase’s are also replaced when used in custom scripts. The custom script is optimized and placed in the custom directory. This script is then ran when the link is called in your web browser. Optimization happens when a change is pushed from development to staging or automatically applied to scripts saved in custom/src.

Notes: Given a standard ROQL query
Select MessageBase from Messagebase where LabelName= 'CUSTOM_MSG_CANCEL_POLICY'

This will then be optimized
Select MessageBase from Messagebase where LabelName= ‘(1000020)’
 

Since this does not exist as a LabelName, then it would not return any results. This will also happen when calling custom scripts.