APEX 24.2: New Text Messaging Features

Search for a command to run...

No comments yet. Be the first to comment.
Oracle APEX ideas and insights that you can read in four minutes or less.
Introduction Between them, Oracle APEX and Oracle REST Data Services (ORDS) provide several powerful integration capabilities. If you run in an Oracle Cloud Infrastructure environment (OCI), even more integration options are available, including DBMS...
Introduction One of the marquee features of APEX 26.1 was AI Interactive Reports. When I started testing this new feature, I was interested to see what was going on behind the scenes. In this post, I

Introduction One of the marquee features of APEX 26.1 is APEX AI Agents. APEX AI Agents allow you to use an LLM and your own PL/SQL and JS tools to perform actions on your data instead of just chattin

Introduction In my previous post, I looked at logging APEX AI Agent requests and responses with Request and Response handlers. Logging is the first step because it shows you what is actually moving th

Introduction Logging is one of the first things you need when building serious AI Agents. Without it, debugging quickly becomes guesswork. You can see the final answer, but not always why the model ch

Context management patterns from building agents in Oracle APEX

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.
Let’s start by creating a Text Message to test with:

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 %.
There is a new Comments field where you can describe what your text message is used for.
You can now subscribe to text messages.
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!
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_NUMBER is 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.
At runtime, APEX substitutes the Text Message and the parameter.

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;
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!