Oracle Forms modernization

Running-and-Debugging-Oracle-Forms-12C

While we develop an application in Oracle Form Builder and an error raise, we need to understand where it’s raised from.

DEBUG option

There are several new features added in Oracle Form Builder12c, mostly, found in the main menu and toolbar. One of them is the Debug option which might come in handy. The option DEBUG is added in the main menu of Forms Builder:

Debug menu in the Oracle Forms Builder 12c main menu

How to proceed with DEBUG option

How can I proceed with this option?  You are supposed to take the steps below:

  1. Specify the application URL in the Oracle Form Builder Preference
  2. Insert Break points in your module using Oracle Form
  3. Generate the execution file of your module and save it in required path.
  4. Run your application adding the debug parameter on WebLogic server.
  5. Take note of Host name and Port number while running your module.
  6. Attach Debug to your module by supplying the Host name and Port number in the Oracle Form Builder popup form.

And that is all. Now we look more deeply on the detail of these steps.

1. Debug Option - Runtime Preferences

You have your application specified in Runtime Preferences. Choose your preferences popup form through menu EDIT-> Preferences…  Then add your application URL in Runtime Tab and click on OK.

Runtime tab of the Forms Builder Preferences with the application server URL

2. Debug Option – Insert / Remove Breakpoints

Insert Break points in your module using Oracle Form Builder

How?  In Oracle Form Builder on your development machine, open your module and right-click on your line number and click on Insert/Remove Breakpoint, where you want to start your debug process.

Breakpoints marked in red beside PL/SQL lines in the Forms Builder editor

3. Debug Option – Execution Files & Path

Generate the execution file of your module and save it in required path.

Folder holding the module's .fmb source and its generated .fmx file

4. Debug Option – URL & Parameters

Run your application adding the debug parameter on WebLogic server as:

  1. Name of the module must be declared: &form=customers_demo.fmx
  2. Debug parameter must set up to Yes: &debug=yes

http://localhost:9001/forms/frmservlet?config=demo_ren&form=customers_demo.fmx&deb ug=yes

Forms application URL in the browser ending with debug=yes

5. Debug Option – URL & Parameters

Take note of Host name and Port number while running your module.  Once you run your application, you have these popups with Host and Port parameters:

Forms popup giving the host name and port to enter in the Attach Debug dialog

6. Debug Option – Attach Debug

At the same time, through the Oracle form builder, you click on "Attach Debug" option from Debug menu then, form builder opens this screen, and you have to define the same information provided by the previous popup in the Attach Debug to form.

Attach Debug dialog in Forms Builder with the host name and port number filled in

Debug Option – Debug mode

Well, you move forward in your application toward the section in the module which you desire to validate the error. Debug process stops the module execution at the same line of the code, which contains the break points.

Forms Builder stopped on a breakpoint in debug mode

Now, Oracle form builder will let you debug your code line by line in your development machine to find the error while the application is running even in WebLogic server.

You can proceed step by step by using F7 or if you want to skip some parts of the code you can use the other options provided here for you.

Forms Builder debugging the code line by line with the debug windows open

Debug Option – Debug Stepping

How do I use the Debug Stepping?

Debug toolbar buttons: Go, Step into, Step over, Step out, Pause and Stop

CommandShortcut
GoF9
Step intoF7
Step overF8
Step outShift+F7
Pause–
Stop–

Here is a detailed image illustrating each debug option and its effects:

Illustration of how each stepping option moves through the code

Debug Option – Debug Console

In the debug console, you have a couple of useful windows which let you analyze more your information.

  • Stack
  • Form values
  • Watch window
  • Variables
  • Breakpoints
  • Global/System variables
  • PL/SQL Packages

Debug console with its Stack, Variables, Watch, Form Values, PL/SQL Packages and Breakpoints windows

Debug Option – Stack window

The Stack window: In this window you may have a follow-up of the Stack Frames.

Stack window showing the current stack frame

Debug Option – Form values

The Form Values window: You have all the values initiated in the items and Parameters of your form and once you step into the line of code which initiates these items and parameters you may find their new values as well.

Form Values window listing the items of the CUSTOMERS block and their values

Debug Option – Watch window

The Watch window: You may define your variable in watch window to follow the value which initiated inside while you move forward in the code.

Watch window following the value of the FILENAME variable

Debug Option – Variables window

The Variables window: You have all the variables defined in your debug section and once you step into the line of code which initiates these variables you may find their new values as well.

Variables window with the FILENAME variable, its value and data type

Debug Option – PL/SQL Packages window

The PL/SQL Packages window: In this window you have a list of the PL/SQL Packages with their values.

PL/SQL Packages window

Debug Option – Global/System Variables window

The Global/System Variables window: In this window you have a list of the Global or system variables.

Global/System Variables window listing system variables such as CURRENT_BLOCK

Debug Option – Breakpoints window

The Breakpoints window: Also, you have a list of your breakpoints with the source code, plus the line number where you can modify them as well.

Breakpoints window listing each breakpoint with its source and line number