Search Results

Wednesday, November 26, 2008

Hide a mandatory field

How to hide a mandatory field in OAF Page

If the business wants to hide a field in the seeded page, you can do it by personalizing the page and set Rendered property to false.
But this solution will not help you if the field is marked as mandatory by the seeded page.

The reasons are Mandatory Validations are usually done at the EO level. Hence even if you hide the mandatory field, the validation would still happen at the server. If the column has not null constraint in the table, it will throw a database error.

Can I extend the VO or EO and remove the mandatory property?
No, you cannot change the mandatory property through extension.

How to fix this?
You can fix this by setting a default value for the mandatory field.

Should I extend the VO/EO and set the default value?
Do not extend the VO/EO for the defaulting logic. Because extensions are applied at the site level and the Oracle seeded pages share the same VO/EO all over the Applications.

Where to default the value?

Extend the controller and set the value in the processRequest(){} method. This is the safest way to default the value to the mandatory field.

After defaulting the mandatory variable, personalize the page and set the rendered property to false.

Article By:
Prasanna Jayaraman

Please post your Ideas and Comments

New to OAF

New to OA Framework

Following are the most frequently asked questions in the OAF forums by new OAF Developers
  1. What is OAF?
  2. What are the prerequisites for learning OAF?
  3. I am a forms developer and I want to learn a web technology, should I go for OAF or ADF?
  4. Where to get the jdeveloper for OA Framework?
  5. How to learn OAF and where to find step by step tutorial?
  6. Can I practice OAF in home?
In this article I am going to explain what the developer should do if he is new to OA framework technology.

What is OAF?
OAF is web development framework based on MVC architecture for developing HTML pages and customizations in the Oracle Applications 11i/R12.

What are the prerequisites for learning OA framework?
You need the basic level knowledge in J2EE, good level of knowledge in Java and Oracle database (very important). Especially in java you should have good knowledge of inheritence, overriding, exception handling and collections etc.

I am a forms developer and I want to learn a web technology, should I go for OAF or ADF?
It depends on the purpose of learning the web technology. If you are an ebiz developer and want to do customization and extensions for the HTML based pages in the Oracle applications 11i/R12 then you should go for OA framework. This statment holds well till the release of fusion applications because ADF is well integrated with fusion apps. Also remember learning OAF is not going to be wasted, because ADF uses same bc4j in the name of ADF bc (of course, with good improvements over bc4j), so OAF developers can easily learn ADF in minimal duration.

If you're a forms developer, you're not working in Oracle Applications and you want to develop a new web application for your business, then you should go for ADF 11g. For more information about difference between OAF and ADF follow this link

Where to get the jdeveloper for OA Framework?
The jdeveloper available in the is meant for j2ee developers. So it cannot be used for OAF development. There are different set of jdeveloper versions available in the metalink corresponding to the OAF version of your Oracle Applications. First you need to identify the version of OA Framework available in the Oracle Application instance.

To know that
  1. Open any OAF page
  2. Select the "About this Page" link located at the bottom of the page.
  3. Choose the technology components tab
  4. There you can find the versions of OAF and all technology components of the Oracle application.
  5. You can find the jdeveloper corresponding to the OAF version in the following metalink note How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12
  6. And you need a Metalink login to view the above link and to download the jdeveloper zip file.

How to learn OA framework and where to find step by step tutorial?
The best way to learn OA framework is to start with toolbox tutorials. If you have any doubts in the tutorial you can refer the Developers guide and Personalization Guide. If you want to refer the documentation for OAF java methods like setForwardURL() etc. you can see it in Java Doc available in the index.htm page.

To See the tutorial index
  1. Go to jdevDoc folder in the path where you unziped your file.
  2. Open the index.htm
  3. There you can find Oracle Application Framework Toolbox Tutorials link.
There are around 15 topics in this tutorial to illustrate the basic and advanced topics of the OA framework. It will take 5-10 days to complete all the lessons in this tutorial. These tutorial lessons include almost everything you might need in the OA framework development and customization.

How to practice it in Home?
Running a OAF page from the jdeveloper needs a Oracle Applications Instance up and running. So should have the whole Oracle Applications instance installed in your laptop/desktop or you should have network connection to Oracle Applications instance.

And if you get any doubts in the OA Framework you can get the experts help at the OAF forum

Article By:

Prasanna Jayaraman

Please post your Ideas and Comments

Tuesday, November 04, 2008

Callable Statement

How to Call a PL/SQL block from OA framework

You can call PL/SQL block from the OA Framework using callable statement. Use the following code from application module.

import java.sql.CallableStatement;
import oracle.apps.fnd.common.VersionInfo;

updateStmt = null;

// Put your PL/SQL block in a String variable.

deleteStmt = "begin delete test_table where header_id = :1; "+
" :2 = xxx_pkg.yyy_function(); end;";

txn = getOADBTransaction();

// Pass the PL/SQL block to the callable Statement

updateStmt = txn.createCallableStatement(deleteStmt, 1);

// Set all the bind variables before calling the execute command

updateStmt.setInt(1, headerIdToDelete);

// And register the output parameter types
updateStmt.registerOutParameter(2, Types.DOUBLE);


// After execute you can get the value of pl/sql block output
Number amount = new Number(updateStmt.getDouble(2));

// Commit the transaction in the database

catch(SQLException sqle) {


If you want to call pl/sql from the controller then get the application module from the pageContext.
And then get the db transaction from the application module
OADBTransaction txn = pageContext.getApplicationModule(webBean).getOADBTransaction();

Article By:
Prasanna Jayaraman

Please post your Ideas and Comments

Call Concurrent Program from OA Framework

How to Call a Concurrent Program from OA framework

OA Framework provides the ConcurrentRequest class to call the concurrent program from the page. The submitRequest() method in the ConcurrentRequest class takes 6 parameters and returns request id of the submitted concurrent request:

public int submitRequest(
String ProgramApplication ,
String ProgramName ,
String ProgramDescription ,
String StartTime,
boolean SubRequest,
Vector Parameters ) throws RequestSubmissionException

ProgramApplication -Application Short name of application under which the program is registered.
ProgramName - Concurrent Program Name for which the request has to be submitted
ProgramDescription - Concurrent Program Description
StartTime - Time at which the request has to start running.
SubRequest - Set to TRUE if the request is submitted from another running request and has to be treated as a sub request.
Parameters - Parameters of the concurrent Request

Here is the example for calling a concurrent program from a OA framework page.

import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.framework.server.OADBTransaction;

public int submitCPRequest(Number headerId) {

try {

OADBTransaction tx = (OADBTransaction)getDBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);

String applnName = "PO"; //Application that contains the concurrent program
String cpName = "POXXXX"; //Concurrent program name
String cpDesc = "Concurrent Program Description"; // concurrent Program description

// Pass the Arguments using vector
// Here i have added my parameter headerId to the vector and passed the vector to the concurrent program

Vector cpArgs = new Vector();

// Calling the Concurrent Program

int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);

return requestId;

} catch (RequestSubmissionException e) {
OAException oe = new OAException(e.getMessage());
throw oe;


How to monitor the submitted concurrent request OA Framework

The Request Monitoring user interface provides the ability to search for a current user's requests. It allows the user to specify criteria to search for a request based on a specific request ID, requests for a specific program or a range of scheduled requests. Using the search results list, a user can select a request to see the details of that request or view its output file. From the Details page for a request, a user can place a hold on a pending request, cancel a pending request or view the request's log file.

You can call the Request Monitoring page by calling following URL

Article By:

Prasanna Jayaraman

Please post your Ideas and Comments