Showing posts with label OAF Tutorial. Show all posts
Showing posts with label OAF Tutorial. Show all posts

Friday, 30 March 2018

Part2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page

Part 2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page

 
In this post , we will do View Object VO extension in Oracle Application OAF web pages. first of all , we will discuss the need of the VO extension in OAF. When we have an requirement to display some more attributes or fields in the OAF page then we do VO extension to meet this requirement. We all know that , We see the data in the OAF page through View Objects(VO) and in a single page can have more then 1 View Objects(VO). First of all , we need to find out that , in which Standard View object , we need to add new Fields in OAF Page. Then we do view Extension , to add this new field in the View Object and then display this new Field in the OAF page through Personalizations.
This is the Second Part of OAF VO Extension. We have already created a OAF project in the J-Developer and now in the Post , we will start doing VO Extension in this Project.
 
Here below is the First part of this Topic.
 
 

Step13:- Creation VO Extension

 
Now right Click on the Project as below and click New.
 
Part2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page


 
Step14:- Now Create View Object as below :-
 
Part2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page

 
 
Step15:- Create Extended VO Name and select the Package.
Now select the Standard VO which you want to Extend Click on the Browse Button under Extends as below and Select the Standard View Object 'TrackExpesneReportsVO'  which we want to Extend in this VO Extension.
 
Part2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page
Select the same path under which your Standard Controller Placed in the Jdevhome folder MyProjects folder.
 
Step17:- Select the 'TrackExpesneReportsCO' Standard Page Controller.

 
 
Step18:- This is the Extended view Object Final Screen Click Next.
 
 
Step19:- This is The Query working for the Standard View Object. Copy the Query of the View Object in the Toad.
Part2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page
 
 
Step20:- Now Add the Custom column 'Attribute5' which you want to display in the OAF Page. Always add the New Column in the Last.
 
OAF VO Extension
 
 
Step21:-Paste the Changed Sql query in the VO Object and Click Next.
OAF VO Extension
 
Step22:-Select the required Check Box and click Finish.
OAF VO Extension
 
 
 
Step23:- This is the Extended VO created As Below.
 
OAF VO Extension
 
Step24:- Now We will do Substitution of this Custom view Object.
Right click on the Project and Click Project Properties.
 
Go to the Substitutions:-
 
OAF VO Extension
 
 
 
 
Step23:- Move the VO file in Java_Top and then Import this View Object with the Help of this Script.
java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/oracle/apps/xxap/oie/server/ TrackExpenseReportsVOEx.xml -rootdir $JAVA_TOP -username apps -password apps -dbconnection " (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server name)(PORT=100001))(CONNECT_DATA=(SERVICE_NAME=SID NAME)))"
 
 
Step23:- Now again go Back to the Web page in application where we want to do this View Object Extension. Now Click on the 'Personalize Link' Highlighted below.
 
 
 
 
 
Step24:- Now click on Create Item Icon as below to add new field in the View Object.
 
 
 
 
Step25:- Create Item with Style 'Message Styled Text'.
 
 
 
Step26:- Give the Item Properties as below.
 
 
Step27:- Give the name of the Extended View Object  in View Instance and the Name of your New View object Column in the View Attribute as below.
 
 
Step28:- Now we can see below Tracking No. field displaying in the OAF Expense Home Page.
 
 
Part2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page

Wednesday, 28 March 2018

Assigning Values to the DFF attributes through SQL query in OAF Page through Controller Extension

Assigning Values to the DFF attributes through SQL query in OAF Page through Controller Extension

 
In this post , We will use SQL to fetch the data from some custom Table and then assign this fetched columns  in the DFF attributes. We will execute the SQL query based on the LOV selected value by the Business user in the OAF page. Here in this requirement , we will take help of Controller Extension to Capture the LOV selection event and then use the LOV selected value to fetch the sql query date and then assign this value to the DFF attributes for the OAF page. This is some thing we are giving solution out of the box from the standard application to capture the external information based on the Value selected by the user in  the LOV. We can then use this external information in the OAF pages through DFF fields.
 
Assigning Values to the DFF attributes through SQL query in OAF Page through Controller Extension
 

Assigning Values to the DFF attributes through SQL query in OAF Page through Controller Extension

 
Here below I am sharing you the Controller Extension for this above requirement.
 
There are the steps this Controller will do.
1.Capture the LOV selection event .
2.Then use the LOV selected value to fetch the sql query date.
3Then assign this value to the DFF attributes for the OAF page.
 
 
 
 public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    {
       super.processFormRequest(pageContext, webBean);
       
         OAApplicationModule am = pageContext.getApplicationModule(webBean);      
 
        String xxinvno=null;
        String Att1=null,Att2=null;
        String result ="";       
        if(pageContext.isLovEvent()) 
        { 
             String lovInputSourceId = pageContext.getLovInputSourceId(); 
             if("XXInvNo".equals(lovInputSourceId))
             { 
              
                  Hashtable lovValue = pageContext.getLovResultsFromSession(lovInputSourceId); 
                  if(lovValue !=null) 
                    { 
                      xxinvno =(String)lovResults.get("XXInvNo"); // "InvNo" is the Return Item specified in the lovMapping 
                          
                    }
                  if (xxinvno!=null) 
                  {
                      String sql = "select customer_name,phone_no from xx_third_pary_data where invocie_number= ="+ xxinvno;
                      try {
                          Connection conn = (Connection)am.getOADBTransaction().getJdbcConnection();
                          PreparedStatement sql1 = conn.prepareStatement(sql);
                          ResultSet rs = sql1.executeQuery();
                          while(rs.next())             
                            {
                             Attr1 = rs.getString(1).trim();
                             Attr2 = rs.getString(1).trim();                             
                             }
                            }
                        catch (Exception e)
                            {  e.printStackTrace();
                            }
                       OAViewObject viewobject1 = (OAViewObject)am.findViewObject("SuppliersHeaderVO");
                          if(viewobject1!=null)
                          {
                           pageContext.writeDiagnostics(this, "Successfully set the VO", 2);
                          }
                          OAMessageTextInputBean viotype = (OAMessageTextInputBean)webBean.findChildRecursive("Attribute1");
                           viotype.setValue(pageContext, Attr1);               
                          OAMessageTextInputBean Tktno = (OAMessageTextInputBean)webBean.findChildRecursive("Attribute2");
                           Tktno.setValue(pageContext, Attr2);     
                          }                   
                      }
              }         
          }


Assigning Values to the DFF attributes through SQL query in OAF Page through Controller Extension
 

Saturday, 24 March 2018

How to Integrate Java Decompiler with J Developer in OAF

How to Integrate Java Decompiler with J Developer in OAF

We often need in OAF to Decompile Class Files to Java Files. When we do Controller Extensions , We did not have Java files of Standard OAF page class files. In Java_Top we can only find the Class Files but to do Controller Extensions we need Java Files so for this we often need to Decompile class files to Java Files in OAF. Either we can Decompile Class files to Java Files outside JDeveloper but that is the Time consuming Job but to ease we can also integrate Java Decompiler with JDeveloper.

 

Step1:- Download the Java Decompiler as Below
 
 
 
Download the Windows version of Java Decompile
 
How to Integrate Java Decompiler with J Developer in OAF
 
 
 
Step2:- Go to JDeveloper ==> Tools ==>External Tool
 
How to Integrate Java Decompiler with J Developer in OAF
 
 
Step3:- Now Click New Button to Integrate Java Decompile with JDeveloper.
 
 
 
Step4:- Click Next
 
 
 
Step5:- Now Select the Java Decompile Executable from the Downloaded Folder where you download Java Decompiler Software.
 
How to Integrate Java Decompiler with J Developer in OAF
 
 
Step6:- click Next
 
How to Integrate Java Decompiler with J Developer in OAF
 
Step7:- Give the Name for Menu Item
Java Decompiler As below Click Next
 
 
 
Step8:- Click Next as below and select the Check Boxes as below :
 
 
Step9:- Click Finish.
How to Integrate Java Decompiler with J Developer in OAF
 
 
Now your Java Decompiler has been integrated with JDeveloper and you can use in the JDeveloper tool as below
 
Now Right Click on the Class file to which you want to Create Java File and Click on Java Decompile.
 
 
How to Integrate Java Decompiler with J Developer in OAF
 
 
 
How to Integrate Java Decompiler with J Developer in OAF

Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

We need Controller Extension when we want to add custom Validations and to add extra monitoring in the Standard process or to Control the Standard Page behavior  then we do Controller Extensions to achieved this requirement. We can control the functionality of the Page through Controller codes and if we want to control the Standard OAF pages then we do OAF Controller Extensions.
 
This is the Second Part of OAF controller Extension. We have already created a OAF project in the J-Developer and now in the Post , we will start doing Controller Extension in this Project.
 
Here below is the First part of this Topic.
 

Step13:- Creation Controller Extension

Now right Click on the Project as below and click New.
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

 
Step14:- Now Create Java Class as below
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step15:- Create Extended Controller Name and select the Package.
Now select the Standard Controller which you want to Extend Click on the Browse Button under Extends as below and Select the Standard Controller 'TrackExpesneReportsCO'  which we want to Extend in this Controller Extension.
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
Step16:- Select the same path under which your Standard Controller Placed in the Jdevhome folder MyProjects folder.
 
Like oracle/apps/ap/oie/webui
 
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step17:- Select the 'TrackExpesneReportsCO' Standard Page Controller.
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step18:-  Java Class values and Click Ok.
 
 
Step19:- Here below your Extended Java Class 'ExpenseReportCOEx' has been created Below. We will write the code to extend standard OAF page under this Java class.
 
 
Step20:- OAF Code of this Extended Java Class as below:
 
 
package oracle.apps.xxap.oie.webui;
import java.sql.SQLException;

public class ExpenseReportCOEx extends TrackExpenseReportsCO {
    public ExpenseReportCOEx() {
    }
   
    public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
       {
         super.processRequest(paramOAPageContext, paramOAWebBean);
       } 
      
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
       {
            Number ReportHeader;
               if ("WithdrawReport".equals(paramOAPageContext.getParameter("event")))
                      {
                          paramOAPageContext.writeDiagnostics(this, "Clicked on withdraw ", 1);
                      }
                     
    if (paramOAPageContext.getParameter("CommitWithdraw") != null)
           {       
           paramOAPageContext.writeDiagnostics(this, "Selected Yes to withdraw ", 1);
            OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
            OADBTransaction txn = am.getOADBTransaction();
            String str="BEGIN xx_insert_withdrawactions.insertrow(P_Header_id => :1);END;";
            OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);
            String Result = "";
    try{
                ReportHeader = new Number(paramOAPageContext.getDecryptedParameter("ReportHeaderId"));
              
           
                 String RptHdrId = ""+ReportHeader;
             Callstmt.setString(1,RptHdrId);
         
             Callstmt.execute();
       
                 paramOAPageContext.writeDiagnostics(this, "xx_insert_withdrawactions proc completed Successfully ", 2);        
             Callstmt.close();
             }   
    catch(SQLException sqle){
                 paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
             try { Callstmt.close(); } catch (Exception e) {
                 paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
             }
             }
            }
            super.processFormRequest(paramOAPageContext, paramOAWebBean);         
           
           
        }      
            
           
}
 
Step21:- Now right Click on this Java class to compile this code. Click Rebuild to compile this Class.
 
 
 
Step22:- Now We have created the Java class file to extend the Standard Java Class.
After that We need to Put this Extended JavaClass'ExpenseReportCOEx' under Java_Top.
Server Path:- ava_top/Oracle/apps/xxap/oie/webui
 
Step23:- Now again go Back to the Web page in application where we want to do this Controller Extension. Now Click on the 'Personalize Page' Highlighted below.
 
 
 
 
 
 
Step24:- Now go to update Personalization under Header of your OAF page.
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event
 
 
Step25:-
Now put the location of your Extended Controller under CO field in the Personalize page.
Extended Controller Location :Oracle.apps.xxap.oie.webui.ExpenseReportCOEx
 
 Part2 OAF Controller Extension In OAF :How to add OAF code in Controller Extension on Button Click Event

 

Thursday, 22 March 2018

How to Execute and Fetch SQL Queries Data Rows in OAF

How to Execute and Fetch SQL Queries Data in OAF

 
Hi Friends , In this post I will show the OAF code to Execute the Sql query in the OAF controller and then Fetch all the rows of this queries in the Same controller to do further Analysis. We often need to user SQL queries in OAF code to do data comparison and to get the values from other modules so using this OAF code will help you allot in you OAF controller Extension to execute and fetch all the rows of the Sql query.
 

How to Execute and Fetch SQL Queries rows in OAF

 
Step1:- Suppose you are doing Controller Extension in your PR approval Notification Page and in your PR you have maintained some values in DFF of 'PO_REQUISITION_LINES_ALL' and here in CO extension you want to fetch these values.
 
 
Step2:-  This is the OAF code to execute and Fetch Sql query results in OAF controller and then can be used for Comparison.
 
 
 public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    {
      paramOAPageContext.writeDiagnostics(this, "XX Start PR ", 1);
     
        String parameterName;
        String COL1_VALUE="";    
        String COL2_VALUE=""; 
        String COL3_VALUE="";    
       
       Number PRHdrId;
            PRHdrId = new Number(paramOAPageContext.getDecryptedParameter("PRHeaderId"));
                if (PRHdrId!=null)
                {
        
    Connection conn = paramOAPageContext.getApplicationModule(paramOAWebBean).getOADBTransaction().getJdbcConnection();
     String Query = "SELECT attribute1 col1,attribute2 col2,attribute3 col3 FROM PO_REQUISITION_LINES_ALL WHERE REQUISITION_HEADER_ID=TO_NUMBER(:1)";

                PreparedStatement stmt = conn.prepareStatement(Query);
                   String PRHdrId = ""+PRHdrId;
                   
     stmt.setString(1,PRHdrId);
     for(ResultSet resultset = stmt.executeQuery(); resultset.next();)
     {
  
   COL1_VALUE = resultset.getString("COL1");
                       COL2_VALUE = resultset.getString("COL2");
                       COL3_VALUE = resultset.getString("COL3");
      paramOAPageContext.writeDiagnostics(this, "Query executed"+COL1_VALUE,1);
                   paramOAPageContext.writeDiagnostics(this, "Query executed"+COL1_VALUE,1);
                   paramOAPageContext.writeDiagnostics(this, "Query executed"+COL1_VALUE,1);
     }
  
 
 
Result Set :-
 
A table of data representing a database result set, which is usually generated by executing a statement that queries the database.
A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the ResultSet object, it can be used in a while loop to iterate through the result set.
 
 
 
How to Execute and Fetch SQL Queries Data Rows in OAF
 
 
How to Execute and Fetch SQL Queries Data Rows in OAF

Wednesday, 21 March 2018

How To Get the LOV Selection Event in OAF Controller For CO Extension

How To Get the LOV Selection Event in OAF Controller For CO Extension

We often need in OAF Controller Extensions to get the Events from the Page to Execute our Custom Code. Suppose If we want to Execute or want to Change some values in the OAF page when the user will select the LOV from the OAF page. For this We can use this below code to Find the LOV Selection Event in the OAF controller and write our custom code inside that Event for Controller(CO) Extension.
 
How To Get the LOV Selection Event in OAF Controller For CO Extension
 

How To Get the LOV Selection Event in OAF Controller For CO Extension

There are two ways by which you can get the LOV selection event in the OAF page.
 
1.pageContext.getLovInputSourceId()
2.pageContext.getParameter(SOURCE_PARAM)
 
 
You can write your Code in the Process Form Request of your CO Extension in this manner
 
You should know the name of your LOV Item in your OAF page so that you can compare this Name with all the Lov selection events in the OAF page because it could be possible there are more then 1 LOV's in the OAF page so you have to distinguish for which LOV selection you want to execute your custom code. 
 
if(pageContext.isLovEvent())
 
  {
String lovInputSourceId = pageContext.getLovInputSourceId();
  if("Country".equals(lovInputSourceId))
{
System.out.println("You can write your Customer Code inside this");
paramOAPageContext.writeDiagnostics(this, "LOV Selection ", 2);
 }
 } 
 

How to Compare the LOV selected value by user in the OAF Page.

 
 if(pageContext.isLovEvent()) 
 {  
      String lovInputSourceId = pageContext.getLovInputSourceId(); 

      if("Country".equals(lovInputSourceId)) {
      paramOAPageContext.writeDiagnostics(this, "LOV Selection ", 2);
           Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId); 
           if(lovResults!=null) 
           { 
                String Country1 =(String)lovResults.get("Country"); // "Country" is the Return Item specified in the lovMap  

           paramOAPageContext.writeDiagnostics(this, "Selected Country "+Country1);
 
 
 
This code is used to do comparison with the LOV selected value in the OAF Page in CO Extension
 
 
How To Get the LOV Selection Event in OAF Controller For CO Extension
 



 

Sunday, 10 March 2013

OAF TUTORIAL :OA Framework(OAF) Learning Tutorial

OAF TUTORIAL : OA Framework(OAF) Learning Tutorial

OAF Represents Oracle Application Framework. OAF is the new technology which is Implemented in the Oracle r12. OAF help use to design the complete Web based forms , earlier in the Oracle 11i this was not feasible and we need to have run time java software to run these forms but in the OAF web pages we don't need these java software and the good part is we can also run the OAF pages in the Mobiles and the Tablets also. The purpose of this OAF Tutorial is the share the free Knowledge of this technology with the Oracle Community. This is the complete Set by step Tutorial , Which can be even refer by the beginners in the OAF and can also refer by the OAF experts too. I have increased the Post difficulty step by step in this Tutorial. I have Started this Tutorial with the Introduction of the OAF then go to Installation of the JDev software to start work on the OAF.
OAF TUTORIAL
OAF TUTORIAL

You will get the complete material of OA Framework(OAF) Learning Tutorial. You can refer this blog as Learning Tutorial to start your Journey in the Oracle OA Framework(OAF). I have shared Step by Step for the each Technical topic of OA Framework(OAF). This is a complete OA Framework(OAF) Learning Tutorial.

OAF Tutorial Lessons:


2.    JDeveloper Installation

3.    Creating Simple Hello world in OAF

4.    How we assign default values in the OAF Page

5.    Creating POP List (List Item) in OAF Page

6.    Part1 Creating LOV in OAF Page

6.    Part2 Creating LOV in OAF Page

7.    Understanding about Page layouts in OAF

8.    How we create a dependent LOV in OAF

9.    Create a data Entry Page in OAF

10.    Updates Records in OAF Page

11.  Delete Records in OAF Page

12.  Calling OAF Page from another OAF Page

13.  Creating OAF Search Page

14(a).  OAF VO Extension : How to add new Column in the Expense Report Summary Home Page

14(b).Part 2 OAF VO Extension : How to add new Column in the Expense Report Summary Home Page

15 (a). Part 1 Controller Extension In OAF :How to add code in Controller Extension on Button Click Event

15(b). Part 2 Controller Extension In OAF :How to add code in Controller Extension on Button Click Event

16. Partial rendering in OAF Page(Conditional Displaying Any Item)

17. Package/Procedure Using in OAF Page

18.Upload File In Oracle Server from Local Machine In OAF Page

19.Dynamic Color change in OA Framework  

20.SPEL In OA Framework Personalizations.

21. Part 1- How we can attach custom LOV in Oracle Standard OAF Page Without doing any customization and extension in standard OAF Page

22. Part 2- How we can attach custom LOV in Oracle Standard OAF Page Without doing any customization and extension in standard OAF Page

P2P Complete Cycle(Configuration & End to End Process) In Oracle Fusion


23.How to Create Dynamic LOV in OAF Through Controller Extension
24.Trigger|Execute Custom Code Based on value Selected in LOV in Standard OAF Page
25.How to get the Name of all Objects and their Run time Value in Running OAF page to use in the controller Extension
26.How to Change Where Condition for View Object (VO) in OAF Technology
27.How to check the Value of View Object(VO) all Columns during Run Time of OAF Page.
28.OAF Important Scripts To Verify and Delete the OAF Extensions from Oracle application.
29.How to Execute and Fetch SQL Queries Data in OAF
30.How to Debug and See Log Messages in OAF Pages
31.How To Get the LOV Selection Event in OAF Controller For CO Extension
32.How to Integrate Java Decompiler with J Developer in OAF
33.How to Create Button in OAF Page Programmatically or Dynamic
34.How to Create Events in OAF Page Programmatically Through Controller Extension
35.Assigning Values to the DFF attributes through SQL query in OAF Page through Controller Extension
36.How to do VO Extension in OAF Through controller Extension: Add New column to Standard VO through Controller Extension
37.Table layout region in OAF. Table region in oaf
38.Types of search pages in OAF
39.Difference between auto customization criteria and result based search in oaf
40.Auto Customization Criteria in OAF
41.What is Root AM in OAF
42.Why can't root AM be extended in OAF
43.Result Based Search in OAF
44.Query Bean in OAF. How to Create Query Bean Search page in OAF
45.Advanced Search Region in OAF. Advanced Search Page in OAF
46.Application Module in OAF.How to attach VO to AM in OAF
47.Entity object in OAF. How to create EO in OAF
48.Exception handling in OAF
49.Dialog message in oaf. How to display popup message in oaf
50.oaexception in oaf. Display message in oaf page

Oracle Application Interview Questions List

New : TOP 23 Most Important Oracle Fusion Interview Questions
New : TOP 20 general ledger interview questions
New: 21 Most Important Oracle r12 Payables Interview Questions
New : TOP 20 general ledger interview questions in oracle apps r12
New: 25 Most Important Oracle receivable interview questions
TOP 33 Most Important Oracle Apps Technical Interview Questions

OAF Personalizations Examples


1.OAF Personalization :How To show Password Hint Option in Oracle E-Business Suite Login Page that can help users to set their Strong password
2.OAF Personalization : How to Display new Field/column in Supplier Search Page
3.OAF Personalization : How to Change the positions of Column & layout in OAF Page
4.How to Delete and De Activate the OAF Personalization in OAF Pages in Oracle Apps
5.How to Migrate OAF Personalizations from One Instance to Another Instance Automatically.

OAF TUTORIAL

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *