AbairTechSolutionDIGITAL SOLUTIONS FOR A SMARTER TOMORROW

Menu

Oracle APEX

Oracle APEX Dynamic Actions: A Practical Guide with Real Examples

By AbairTech Solution · Practical guides for Oracle, ERP & business software

Published by AbairTech Solution · Reviewed November 2026 · Editorial policy

Dynamic Actions are how Oracle APEX makes a page react without a full submit: showing a field when a checkbox is ticked, calculating a total as the user types, fetching a customer’s balance when they are selected, or refreshing a report after a modal dialog closes. They are declarative, which means most behaviour can be built without writing JavaScript — but only if you understand how the pieces fit together.

1. The anatomy of a Dynamic Action

Every Dynamic Action has three parts:

There is also a Server-side Condition. It is evaluated once when the page is rendered and decides whether the Dynamic Action exists on the page at all. Mixing these two conditions up is one of the most common causes of “my Dynamic Action does nothing”.

2. Example: show a field only when needed

On a sales order page, show the Credit Days field only when the payment type is Credit.

Tick Fire on Initialization for the Show and Hide actions so the page starts in the correct state when an existing order is opened.

3. Example: calculate a line total

Calculate P10_TOTAL whenever quantity or price changes. Use the Change event with both items in the selection, then a Set Value action of type JavaScript Expression:

(Number($v('P10_QTY')) || 0) * (Number($v('P10_PRICE')) || 0)

This gives instant feedback. Always recalculate stored totals on the server when the page is saved; values calculated in the browser can be changed by the user.

4. Example: fetch data from the database

When a customer is selected, display their outstanding balance. Use Set Value with type SQL Statement or PL/SQL Function Body:

SELECT NVL(SUM(amount_due), 0)
  FROM customer_invoices
 WHERE customer_id = :P10_CUSTOMER_ID
   AND status = 'OPEN'

The critical setting is Items to Submit. The browser must send P10_CUSTOMER_ID to the server, otherwise the bind variable still holds its old session-state value and the query returns the wrong result.

5. Execute Server-side Code

Use this action to run PL/SQL without submitting the page – for example, to mark a task as read or to generate a document number:

:P10_DOC_NO := doc_numbering_pkg.next_number(p_doc_type => 'SO');

Set Items to Submit for inputs and Items to Return for values the code sets, here P10_DOC_NO. Server-side code in a Dynamic Action is not automatically protected by page-level validations, so validate inputs inside the PL/SQL and check authorization where the action changes data.

6. Refreshing regions after a modal dialog

A frequent pattern is a report with an “Add” button that opens a modal page. To refresh the report when the dialog closes:

If the report depends on page items, list them in the region’s Page Items to Submit so the refreshed query uses the current values.

7. Confirm before destructive actions

Add a Confirm action as the first step before deleting or posting records. If the user cancels, the following actions do not run. Combine this with an authorization scheme on the button and on the server-side process – a confirmation dialog is a usability feature, not a security control.

8. Wait for results

Actions run in sequence, but some are asynchronous. If a later step depends on a value returned by the server, make sure Wait For Result is enabled on the server call so the next action does not run with stale data.

9. Common mistakes

Checklist

Building an Oracle APEX application?

AbairTech builds responsive Oracle APEX applications for ERP, POS, HR and finance teams, and modernizes Oracle Forms screens into APEX.

Oracle APEX ServicesMore Guides