# APEX 24.2: New Text Messaging Features

# Introduction

APEX 24.2 introduced several new [marquee features](https://apex.oracle.com/en/platform/features/whats-new-242/). 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.

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Although your application may not be multilingual today, using APEX Text Messages instead of hard-coding messages in your code is still a best practice. You will thank me later!</div>
</div>

<div data-node-type="callout">
<div data-node-type="callout-emoji">⚠</div>
<div data-node-type="callout-text">Ensure you read the entire post; the final section has an important deprecation.</div>
</div>

# Changes in APEX 24.2

Let’s start by creating a Text Message to test with:

![Example Oracle APEX Text Message](https://cdn.hashnode.com/res/hashnode/image/upload/v1739724940230/05d621f8-fb91-4d3b-b70c-777cb9fe351b.png align="center")

## 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.

![Enable Oracle APEX Text Message Picker](https://cdn.hashnode.com/res/hashnode/image/upload/v1739724471790/c1f111d1-b6ef-47dc-8fc4-cc070fef0659.png align="center")

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

![Select and Oracle APEX Text Message using the Text Message Picker](https://cdn.hashnode.com/res/hashnode/image/upload/v1739724316292/2ce40385-9214-4e85-8bf7-daced5f116be.png align="center")

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

![Image showing the result of picking a Text Message using the Text Message Picker](https://cdn.hashnode.com/res/hashnode/image/upload/v1739725297264/a47fa038-0959-4635-b5a3-4f0cdb6e7118.png align="center")

* 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.
    

# The Result

At runtime, APEX substitutes the Text Message and the parameter.

![Oracle APEX Text Message Substitution Result](https://cdn.hashnode.com/res/hashnode/image/upload/v1739729759901/3cb59e01-50a2-4664-a499-6d52f425563e.png align="center")

# 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](https://docs.oracle.com/en/database/oracle/apex/24.2/aeapi/MESSAGE-Function.html) will tell you that this API has been deprecated in APEX 24.2. Instead, you need to start using [APEX\_LANG.GET\_MESSAGE](https://docs.oracle.com/en/database/oracle/apex/24.2/aeapi/APEX_LANG.GET_MESSAGE-Function.html).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1739728592280/ab8fe74f-ca36-4a6a-a56e-5056c32363f5.png align="center")

<div data-node-type="callout">
<div data-node-type="callout-emoji">🤮</div>
<div data-node-type="callout-text">I am not looking forward to the day when I will have to go through all the code I have ever written and change out APEX_LANG.MESSAGE to APEX_LANG.GET_MESSAGE!</div>
</div>

As you can see from the example below, the signature for apex\_lang.get\_message is quite different:

```sql
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!
