Call Concurrent Program from OAF Page
I have seen many developers use fnd_request.submit_request to call the concurrent program from the OAF page, which is not only bad practice also makes controller code cumbersome. Calling Concurrent request is very much simple , you just need to import the relevant classes and pass the program name and Parameters.
//Classes to be imported
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.cp.request.RequestSubmissionException;
OADBTransaction tx= am.getOADBTransaction();
// Initialize the ConcurrentRequest Class
java.sql.Connection con = tx.getJdbcConnection();
ConcurrentRequest requestObject = new ConcurrentRequest(con);
//Application Short name under which the calling concurrent program is registered
String applShortName = "XX";
// Calling Concurrent program Short name
String cpName = "XXCONCSHORTNAME";
// Calling Concurrent program Description
String cpDesc = "Program call through OAF";
Vector vector = new Vector();
vector.addElement(String.valueOf(OrderId));
vector.addElement(String.valueOf(OrderType));
vector.addElement(String.valueOf("N"));
// Concurrent Program submission
int requestId=0;
try {
requestId =
requestObject.submitRequest(applShortName, cpName, cpDesc, null, false, vector);
}
catch (RequestSubmissionException e)
{
// TODO
throw new OAException("Concurrent error--"+e, OAException.ERROR);
}
tx.commit();
System.out.println("e requestId--"+ requestId);
throw new OAException("Concurrent Program submitted succesfully " and Concurrent Request id is--"+requestId, OAException.INFORMATION);
}
Your work is so good I like Your articles writing your writing is so clear I liked it you are a great writer. I appreciate your work online learning platform
ReplyDelete