Inside Oracle APEX – a blog that helps to get more out of Oracle Application Express (APEX) for your daily development work!

Main menu

Post navigation

Hacking the APEX Debugger

You like the build-in APEX Debugger which you can be activated through the Developers Toolbar?

All links which APEX is generating when rendering the page contain the debug flag too. But when you enter something into a form and press the submit button or any other button, the Debug mode is disabled and you don’t see what APEX is doing to process the data.

It’s time to “hack” the APEX debugger!

Go to Shared Components and create two Application Items named APEXLIB_SAVED_DEBUG and APEXLIB_SAVED_REQUEST

Create a new Application Process with the following settings

Name: ApexLib_SaveRequest

Sequence: 1

Point: On Submit – After Page Submission – Before Computations and Validations

That’s it, when you now active the Debug Mode by clicking into the Developer Toolbar, the debug mode setting will also stay when you press a button to submit the page.

Now you see how APEX is processing your changed data and which branches are firing.

Background information

What does the code do?

First it stores the current REQUEST information into a field, because after the data has been processed a redirect occurs which clears the info in the :REQUEST bind variable, but we need that info.

In the second process (on-load) we check if the page has been called with a request. For page calls with an URL link the request is always null. So if it’s a REQUEST call we use our stored value from the last page rendering (where the debug flag is contained in the URL).

Happy debugging!

Update

As Vikas was pointing out on the OTN forum, the hack is only useful for pre-2.2 APEX versions, because APEX 2.2 had an enhancement in that area.