NEW Written for Oracle APEX 26.1 · JavaScript and PL/SQL

Oracle APEX 26.1 API by Example

Every method and event of the APEX JavaScript API and every procedure and function of its PL/SQL packages — more than 1,850 APIs — each with an example that ran in APEX 26.1 and the output it really produced. Plus 32 practical recipes for the tasks you meet in every application.

  • apex.item
  • apex.region
  • Interactive grid
  • apex.server
  • apex.model
  • APEX_JSON
  • APEX_EXEC
  • APEX_WEB_SERVICE
The book Oracle APEX 26.1 API by Example, in front of an open spread with the layout of an entry and an interactive grid recipe
1,853APIs documented
518Runnable examples
32Practical recipes
63PL/SQL packages
528Pages
Why this book

The API reference, with the examples it never had

The official reference tells you what a function takes. It rarely shows what it returns, how it behaves on a real page, or what to combine it with. This book runs every one of them and shows you.

The usual way

Signatures, guesses, and trial runs

  • Parameter lists with few examples, and almost never the output they produce.
  • You test each call yourself to learn what it really returns.
  • Snippets scattered over blogs and forums, each for a different APEX release.
  • Behavior that differs from the documentation, found only in production.
With this book

Every API, run and shown

  • An example for every method, event, procedure, and function, run in APEX 26.1.
  • The real output of every example, printed as it came out — none of it typed by hand.
  • 32 recipes that combine APIs: grid toolbars, dialogs, shortcuts, live totals.
  • 18 places where APEX 26.1 behaves differently from its documentation, collected in Appendix B.
How an entry works

Syntax, example, real output

Every entry has the same parts, in the same order: what the API is for, how to call it, an example that runs in the book's API Lab, and exactly what that example printed.

01

Find the API

By task in the contents, or by name in Appendix C, which lists all 1,853 APIs with their pages. Each entry starts with its purpose and syntax.

Chapter 4 · the syntax
item.setValue( pValue, [pDisplayValue], [pSuppressChangeEvent])
02

Run the example

A short, practical example on a page of the API Lab, the application you install from the book's code repository.

Chapter 4 · the example
const item = apex.item("P20_TEXT"); item.element.on("change", () => console.log("change event, new value:", $v("P20_TEXT")));item.setValue("Summit Down Sleeping Bag"); item.setValue("Trail Runner Pack", null, true); // no change event console.log("value now:", $v("P20_TEXT"));
03

Read the real output

What the example printed when it ran in APEX 26.1 — here, that the third argument suppresses the change event.

Output, as it ran
change event, new value: Summit Down Sleeping Bag value now: Trail Runner Pack
Look inside

Real pages from the book

Syntax blocks, parameter tables, examples with their output, screenshots where the page changes, and recipes that say where each piece of code goes. Click any page to read it.

Pages shown from the full-color edition. The Kindle edition has every screenshot and code listing in color; the paperback is printed in black and white.

Recipes

32 recipes for the tasks you meet every day

Chapters 4 to 16 end with recipes that combine several APIs. Each one says where the code goes — a dynamic action, the page's load code, a grid's Initialization JavaScript Function — and shows the result.

API Lab · Toolbar button
An interactive grid with a Mark as Flagship button in its toolbar and two selected rows The row actions menu of an interactive grid with a Store Details entry An interactive grid with the rows of recently opened stores in amber A map of Chicago with the info window of a store A dialog listing the keyboard shortcuts of a page Horizontal bars of the five largest stores by floor area An interactive grid on a narrow phone screen with four columns

Chapter 14: a Mark as Flagship button in the grid's toolbar, enabled only while rows are selected, sets a column and saves.

What the book covers

Both APIs of Oracle APEX, completely

23 JavaScript namespaces, 13 interfaces, and 9 widgets with 615 methods and 72 events — and all 63 APEX_ packages with their 917 procedures and functions.

CH 3The apex namespaceapex.env, apex.jQuery, the page events, and every global function such as $v and $s.
CH 4–6Items and regionsItem and region interfaces, cards, faceted search, template reports, interactive reports, and maps.
CH 7–8Pages, dialogs, messagesSubmit and validate, navigation and dialogs, messages, text messages, locales, and dates.
CH 9–12Server calls and actionsapex.server, dynamic actions, storage and PWA, templates, htmlBuilder, and actions with shortcuts.
CH 13–16Model, grid, and treesapex.model, the interactive grid and its views, the grid widget, trees, menus, and icon lists.
CH 17–19Session, APEX_UTIL, stringsSessions and session state, page and region context, APEX_UTIL, APEX_STRING, and escaping.
CH 20–22JSON, collections, APEX_EXECAPEX_JSON, file parsing and ZIP, collections, APEX_EXEC for any data source, and data export.
CH 23–24Web services and securityREST calls, Web Credentials, OAuth and JWT, authentication, authorization, and access control.
CH 25–27Mail, errors, reportsE-mail, printing and barcodes, error handling, debugging, translation, and the IR and IG APIs.
CH 28–29Workflows and AI 26.1Human tasks, workflows, automations, background processes, APEX_AI agents, search, and spatial.
CH 30–31Plug-ins and lifecycleAPEX_PLUGIN and its utilities, exports, installs with APEX_APPLICATION_INSTALL, and dependencies.
CH 32AdministrationInstance and workspace administration, UI defaults, the database dictionary, and data generation.
Contents

Three parts, 32 chapters

A reference you do not read front to back: start with Chapters 1 and 2, then go to the API you need. The JavaScript chapters end with recipes.

IChapters 1–2

Getting Ready

How an entry is laid out, and the API Lab: the ORBIT schema and the application in which every example runs.

  • 1How to Use This Book
  • 2The API Lab
IIChapters 3–16

The JavaScript API

Every namespace, interface, and widget of the APEX JavaScript API, with a recipes section at the end of the chapters from 4 on.

  • 3The apex Namespace and Global Functions
  • 4Items: apex.item
  • 5Regions: apex.region
  • 6Region Types: Cards, Facets, Reports, and Maps
  • 7Pages, Navigation, Dialogs, and Themes
  • 8Messages, Languages, Locales, and Dates
  • 9Server Calls, Dynamic Actions, Events, and Debugging
  • 10Storage and Progressive Web Apps
  • 11Utilities, Templates, and Widgets
  • 12Actions
  • 13The Data Model: apex.model
  • 14The Interactive Grid
  • 15Grid, Table Model View, and Record View
  • 16Trees, Menus, and Icon Lists
IIIChapters 17–32

The PL/SQL API

All 63 APEX_ packages, grouped by what they do, from session context to administration.

  • 17Application, Session, and Page Context
  • 18APEX_UTIL
  • 19Strings, Escaping, and Markup
  • 20JSON, Parsing, and ZIP Files
  • 21Collections
  • 22Data Access and Export: APEX_EXEC
  • 23Web Services, Credentials, and Tokens
  • 24Authentication, Authorization, and Access Control
  • 25E-mail, Printing, and Barcodes
  • 26Errors, Debugging, and Translation
  • 27Interactive Reports and Grids
  • 28Tasks, Workflows, Automations, and Background Processes
  • 29Generative AI, Search, Maps, and PWA
  • 30Plug-ins
  • 31Application Lifecycle: Install, Export, and Dependencies
  • 32Instance and Workspace Administration
A–CAppendices

Deprecated, New, and the Index

What to use instead of a deprecated API, what is new in 26.1, and every API by name.

  • ADeprecated APIs and Their Replacements
  • BWhat Is New in the 26.1 APIs
  • CIndex of Every API
New in Oracle APEX 26.1

What is new, and where 26.1 differs from its documentation

New and changed APIs carry a New in 26.1 badge where they are documented. Running every example also turned up behavior the documentation does not describe; Appendix B collects both.

29
APEX_AI agentschat and generate with agents, tools, file attachments, and JSON response schemas
11
Named templates and htmlBuilderdefineTemplates and applyNamedTemplate, and markup that works under a strict Content Security Policy
6
interactiveReportRegionthe interactive report's interface, documented for the first time, with row selection
15
Grid cell rangesgetSelectedRanges and setSelectedRanges, cut and paste of cell ranges
32
APEX_DB_DICTIONARY and APEX_INSTANCE_DEBUGdescriptions of tables for language models, and instance debugging without SYS
28
Workflows and tasksDELETE_WORKFLOWS, SET_ACTIVITY_DUE_DATE, DELETE_TASKS, and more
24New in 26.1 badges on new and changed APIs
18places where 26.1 behaves differently from its documentation
1,853APIs in the index of Appendix C, each with its page
47entries in Appendix A: deprecated APIs and what to use instead

Run in 26.1

Every example ran in Oracle APEX 26.1 on Oracle AI Database 26ai while the book was written.

Real output

No output was typed by hand: the book prints exactly what each example produced.

One sample schema

All examples use the ORBIT schema of the first book, installed with one script.

Free to run

Oracle AI Database 26ai Free, APEX, and the API Lab application from the code repository.

Vinish Kapoor

Oracle ACE Pro · Oracle APEX developer and architect

  • Oracle ACE every year since 2020
  • More than twenty years with Oracle
  • Author of Oracle APEX 26.1: The Complete Guide
About the author

From Oracle Forms to APEX 26.1

Two decades of database applications

Vinish wrote his first programs in 2001 and moved to Oracle Forms, SQL and PL/SQL soon after. He has built database applications for healthcare, education, hospitality, logistics, legal services, finance and retail.

An APEX developer and architect

Today most of his work is done in Oracle APEX: from migrating large Oracle Forms systems to modern web applications, to products of his own such as the Rounds hospital management system and VinAura PDF, a visual report designer for APEX.

The companion to The Complete Guide

His first book, Oracle APEX 26.1: The Complete Guide, teaches how to build a complete application. This one documents the APIs behind it, on the same ORBIT sample schema. His blog, vinish.dev, is read by developers around the world for its Oracle APEX, SQL and PL/SQL tutorials.

Every JavaScript method and event. Every PL/SQL procedure and function. Each with a working example.

Get the book
  • Paperback, 528 pages
  • Kindle edition in color
  • Free code on GitHub
FAQ

Frequently asked

Anything else? Ask on vinish.dev.

Who is this book for?

APEX developers who write JavaScript in their pages and PL/SQL behind them, and want to know exactly what each API does before they use it. It is a reference: you look up the API you need, read its entry, and run its example.

Do I need the first book?

No. This book stands on its own. It uses the same ORBIT sample schema as Oracle APEX 26.1: The Complete Guide, which teaches how to build a complete application; this one documents the APIs behind it in depth.

What exactly does it cover?

The whole APEX 26.1 JavaScript API — 23 namespaces, 13 interfaces, and 9 widgets with 615 methods and 72 events — and all 63 APEX_ PL/SQL packages with their 917 procedures and functions. Deprecated APIs are listed with their replacements in Appendix A.

Is the output really from running the code?

Yes. A runner executed every example in Oracle APEX 26.1 on Oracle AI Database 26ai, and the book prints what it produced: console output for JavaScript, query results and DBMS_OUTPUT for PL/SQL, and a screenshot when the page changes.

What are the recipes?

32 practical tasks at the end of Chapters 4 to 16, such as getting the selected rows of an interactive grid, adding a toolbar or delete button, refreshing a report when its dialog closes, or saving with Ctrl+S. Each says where the code goes and shows the result.

Where is the code?

On GitHub, free: the api-book folder of github.com/devvinish/apex-book-code-examples has the API Lab application and all 518 examples with their outputs, next to the ORBIT sample schema.

Is the paperback in color?

The paperback is printed in black and white on white paper, 8.5 by 11 inches, 528 pages, with a matte cover. The Kindle edition shows every screenshot and code listing in color.

Which versions does it cover?

Oracle APEX 26.1 on Oracle AI Database 26ai. New and changed APIs carry a New in 26.1 badge, and Appendix B lists them together with the behavior that differs from the documentation.

Get the book

Paperback or Kindle, on Amazon

Both editions have the same 32 chapters and three appendices. Pick the paperback for your desk and the Kindle edition for color screenshots and code on any screen.

  1. Get the bookFrom Amazon, in the edition you prefer.
  2. Install the API LabThe ORBIT schema and the lab application from the code repository, as Chapter 2 describes.
  3. Look up an APIRead its entry, run its example, and compare your output with the book's.

Paperback

$44.99on Amazon.com

  • 528 pages, 8.5 × 11 in
  • Black and white on white paper
  • Matte cover
  • ISBN 9798176933673
Buy the paperback

Kindle edition

$12.99on Amazon.com

  • Screenshots and code in color
  • Reflowable on any Kindle
  • Linked contents and index
  • Kindle apps for phone, tablet and PC
Buy for Kindle
github.comdevvinish / apex-book-code-examples
Public

The code of the book, free, in the folder api-book: the API Lab application and all 518 examples with their outputs, next to the ORBIT sample schema.

  • setup/the API Lab application and its install script
  • examples/js/the JavaScript examples and the 32 recipes
  • examples/plsql/the PL/SQL examples, one folder per package
Open on GitHub
Or clone it
git clone https://github.com/devvinish/apex-book-code-examples.git

00