Skip to main content

Command Palette

Search for a command to run...

How to Customize the Item is Required Error Message in Oracle APEX

Updated
3 min read
How to Customize the Item is Required Error Message in Oracle APEX
M

I'm Mohamad, a versatile software developer with a passion for creating innovative solutions and solving complex problems. Throughout my career, I've had the opportunity to work on a variety of projects and technologies, such as JavaScript, Oracle APEX, PL/SQL, and SQL. I'm not just a developer; I'm a problem solver who enjoys tackling challenges head-on. I thrive in collaborative environments and am constantly exploring new technologies to stay at the forefront of the industry.

Oracle APEX automatically displays a default error message whenever a required page item is left empty. While this message is functional, it may not always be the most user‑friendly or consistent with your application’s tone.

Fortunately, APEX gives you two clean, supported ways to override this message:

  1. Using the JavaScript API (apex.lang.addMessages)

  2. Using Text Messages in Shared Components

Both methods are upgrade‑safe and work across all modern APEX versions.

Let’s walk through each approach.

Understanding the Message Key

APEX uses internal message keys to display system messages. The key for required-item validation is: APEX.PAGE_ITEM_IS_REQUIRED

and the value of this key is: “#ITEM_NAME# must have some value.”

It is perfectly fine, but you might want to:

  • Use friendlier language

  • Provide clearer instructions

  • Match your brand’s tone

By overriding the value of the APEX.PAGE_ITEM_IS_REQUIRED key, you can change the message everywhere it appears.

Overriding the Required Item Message Using JavaScript

APEX’s JavaScript API makes it easy to override the default error message. The apex.lang.addMessages() function lets you redefine system messages at runtime.

Here’s the simplest example:

apex.lang.addMessages({
    "APEX.PAGE_ITEM_IS_REQUIRED": "#LABEL# is required."
});

Upon execution, APEX will utilize your custom message instead of the default.

This approach can be employed on a page-level basis to customize the error message displayed on a specific page. Just add the code to:

Page Designer → Page → JavaScript → Execute when Page Loads

This affects only the current page.

💡 Note the #LABEL# placeholder which refers to the page item label.

Why This Method Is Better Than Other Approaches

Some developers try to customize error messages by:

  • Injecting JavaScript into validations

  • Using dynamic actions

  • Manipulating DOM elements after errors appear

These approaches are brittle and can break after APEX upgrades.

Using apex.lang.addMessages() is:

  • Official

  • Supported

  • Upgrade‑safe

  • Centralized

  • Multilingual

It’s the cleanest way to customize system messages.

Overriding the Message Using Text Messages

If you prefer a declarative, no‑code approach, APEX also lets you override system messages using Text Messages. This is ideal for multilingual applications or if you want message management in one place.

In your application, navigate to the shared components and locate the globalization section. Within this section, find the text messages and create a new one, as illustrated in the provided screenshot.

In both approaches, the result will be the same. To test it, create a required text field item and a submit button on one of the pages in your application, and try to submit the page when the text field item is empty.

This approach will be applied on the application level, which means you override the error message on all pages in your application.

💡 Notice how the #LABEL# placeholder is replaced by the text field label.

Conclusion

Customizing the Item is required error message in Oracle APEX is one of the simplest ways to improve user experience. Whether you prefer a declarative approach using Text Messages or a flexible JavaScript solution using apex.lang.addMessages, APEX gives you full control over how system messages appear.

Both methods are clean, supported, and upgrade‑safe — and once you start using them, you’ll find they’re perfect for customizing many other APEX messages as well.


References

AI tools were used to help draft portions of this work.