Tuesday 18 March 2014

Call OAF Page from D2K form

This blog is about to call OAF page from D2K form. We will take one D2K form from there we will try to call our OAF Page with parameters. In OAF page, there it will show that parameter values as message when it will open
 
Let us Create Our OAF Page
 
1. Create a New OA Workspace and Empty OA Project
File> New > General> Workspace Configured for Oracle Applications
File Name – CallOAFfromD2KForm
Project Name – CallOAFfromD2KProj
Default Package -- prajkumar.oracle.apps.fnd.CallOAFfromD2K
 
2. Create Application Module AM
CallOAFfromD2KProj right click > New > ADF Business Components > Application Module
Name -- CallOAFfromD2KAM
Package -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.server
Check Generate JavaFile(s)
 
3. Create a OA components Page
CallOAFfromD2KProj right click > New > OA Components > Page
Name -- CallOAFfromD2KPG
Package -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.webui
 
4. Modify the Page Layout (Top-level) Region
ID -- PageLayoutRN
Region Style – pageLayout
Form Property – True
Auto Footer -- True
Window Title – OAF Page Call From D2K Form Window Title
Title -- OAF Page Call From D2K Form Header
AM Definition -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.server.CallOAFfromD2KAM
 
5. Consider following D2K form
This Form has First Name and Last Name. We will send First Name and Last Name values to our OAF page as parameter
 

 
6. Add following Code in WHEN_BUTTON_PRESSED trigger of SUBMIT button
 

 
DECLARE
BEGIN
 fnd_function.execute
 (   FUNCTION_NAME  =>'CALL_OAF_FROM_D2K',
     OPEN_FLAG              =>'Y',
     SESSION_FLAG         =>'Y',
     OTHER_PARAMS     =>'FIRSTNAME=' || :CALLOAFFROMD2KBLOCK.FIRST_NAME || '&LASTNAME=' || :CALLOAFFROMD2KBLOCK.LAST_NAME
 );
END;

 
Note – Here FUNCTION_NAME is OAF page function name
 

 
7. Add a Controller in OAF Page
Select PageLayoutRN right click > Set New Controller
Package Name -- prajkumar.oracle.apps.fnd.CallOAFfromD2K.webui
Class Name -- CallOAFfromD2KCO
 
8. Add following Code in Controller
 
import oracle.apps.fnd.framework.OAException;
...

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processFormRequest(pageContext, webBean);   

 String firstName = pageContext.getParameter("FIRSTNAME") ;
 String lastName = pageContext.getParameter("LASTNAME") ;

 String message = "Hello " + firstName + " " + lastName;

 throw new OAException(message, OAException.INFORMATION);
}

 
9. Build Your Controller
 
10. Congratulation you have successfully finished. Run Form and Test Your Work
 

 

 

1 comment:

  1. oracle-oaf-online-training
    Hyderabadsys oracle-oaf-online-training online training completely unique & genuine training programe instution.so we give any one student to software cource 100% genine.Hyderbadsys oracle-oaf-online-training completely IT sector.we have lot of employes are working hear.so we can give practical knowledge to the students. after complete the course we give with certification, so it is useful to select multy national companies easily. Hyderbadsys oracle-oaf-online-training charge fees is economical cost,compare to other training instutions. Hyderbadsys oracle-oaf-online-training give complete live projects to the students.it is vey useful to the students.
    Hyderbadsys oracle oracle-oaf-online-training have superb trainer to the students Hyderbadsys oracle oaf online training on the web training give a best training for oracle oaf in India. so we're prepared to give best training to students. so student have any doughts easily can clarify.we have lot of batches hence students can take any batch, for that student convince. so he can select any batch. Hyderbadsys oracle oaf E-Training give teaching to the all students 24/7 per day. A solid strategy for entering, cleanup and updating the information for the oracle oaf .
    +India: +91 9030400777
    Usa: +1-347-606-2716
    Email: contact@Hyderabadsys.com

    #201, Near by RTO office,
    Kondapur, Hitech city,
    Hyderabad, 500084,India.

    ReplyDelete