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

 

 

 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Welcome to My Oracle World Puneet Rajkumar

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today