Wednesday 30 October 2013

Call 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(); 
cpArgs.addElement(headerId.stringValue()); 


// Calling the Concurrent Program

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

return requestId;

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

}
}

Calling Oracle APPS Form with parameter from OAF Page






1. Create Button as below
 2. set the Destination URL :

form:EAM:EAM_ASSET_MANAGEMENT:STANDARD:EAM_LUBRICANT_DETAILS:P_ACTIVITY_NAME="{@AssetActivity}"\P_ASSET_NUMBER="{@AssetNumber}"\P_CALLED_FROM="OAF"



//form:APPLICATION_SHORT_NAME:RESPONSIBILITY_KEY:DATA_GROUP_NAME:FORM_FUNCTION_NAME 


3. Set the View Instance name to VO of the parameter
    In  my case the  View Instance is WorkOrderDetailsVO