APEX 24.2: New Text Messaging Features

Introduction
APEX 24.2 introduced several new marquee features. These were mainly focused on AI RAG, Vector Search, and Fusion Integration improvements. This post will focus on a small but significant change to how Text Messages can be used in APEX. Text Messages are essential because they keep end-user messages out of your code where they are harder to maintain. More importantly, APEX Text Messages allow seamless translations for multilingual applications.
Changes in APEX 24.2
Let’s start by creating a Text Message to test with:

Named Parameters
You can now include named parameters in your text messages instead of %0, %1, etc. This makes the message much more readable. In the screenshot above, I have included a single names parameter called PHONE_NUMBER. As with the old approach, named parameters must be prefixed with a %.
Comments
There is a new Comments field where you can describe what your text message is used for.
Subscription
You can now subscribe to text messages.
Text Message Picker
The text message picker is a great new feature. Before this feature, I would find myself with two open tabs, copying and pasting text message names from one window to another. Now, you can select Text Messages right from the builder!
Enabling Text Message Picker
Enable the text message picker from the Utilities menu → Show → Text Messages Picker.

Once enabled, globe icons appear on properties that allow text message substitution. Pretty neat!

After selecting a text message, APEX inserts the text message and any parameters into the property field.

The Text Message variable
PHONE_NUMBERis included in the message syntax. This is initially set to ““; in my example, I have added a reference to the page item&P1_PAGE_NUMBER.The new Text Message syntax is a little shorter and much easier to read than the old syntax, and adding parameter substitutions makes these changes quite useful.
The Result
At runtime, APEX substitutes the Text Message and the parameter.

PL/SQL API Changes
In previous versions, we would use APEX_LANG.MESSAGE to get the text from Text Messages in PL/SQL. A quick look at the documentation for APEX 24.2 will tell you that this API has been deprecated in APEX 24.2. Instead, you need to start using APEX_LANG.GET_MESSAGE.

As you can see from the example below, the signature for apex_lang.get_message is quite different:
DECLARE
l_message VARCHAR2(1000);
BEGIN
l_message := apex_lang.get_message
(p_name => 'PHONE_NUMBER_VALIDATION',
p_params => apex_t_varchar2 ('PHONE_NUMBER', :P1_PHONE_NUMBER));
apex_debug.info (l_message);
END;
Conclusion
APEX 24.2 introduces several improvements to Text Messages, including the ability to use named parameters, a new Comments field to describe text messages, subscription features, and a convenient Text Message Picker. These enhancements make text messages more readable and easier to manage, while supporting seamless integration and multilingual capabilities in applications.
Time to get started on planning the remediation effort for changing APEX_LANG.MESSAGE to APEX_LANG.GET_MESSAGE!






