Saturday 30 June 2018

How to use advanced table in oaf

How to use advanced table in oaf

In this post , We will be discuss about advanced table in the oaf. Advanced table is the region style available in the OA framework. We use Advanced Table , when we want to represent the data in the OAF page in more presentable form and allow users to do multiple operations with this set of data in the OAF page.
 
1.In advanced table , we can create the Sortable header for each columns of the table. It means we can sort the data of the Table through its Table Column in the OAF Page.
2.In Advanced Table , we can create the Summary total in the footer of the Advanced Table. This is the Add on to create the Total in the footer of the Advanced Table.
3.In Advanced Table , We can create the Button to insert new row in the Table to insert data by the user in the OAF Page.
4.Advanced Table provides Multi Select and Single Select options by which if we can control the data selection in the Advanced table region .
 
Here below I have create the workspace 'XXAdvancedTable' under this workspace we have created the Project 'XXAdvancedTable'  . Under this project , we have created the Page 'XXAdvancedTablePG'.
 
Step1:- We have create the  'XXAdvancedTablePG' as below , under this page region We have created the new region with style 'AdvancedTable'.
 
Right Click on the Page region and click on the region as below. This will create the new region as below.
 
 
How to use advanced table in oaf
 
 
Step2:- Change the Region style 'advancedTable' in the property inspector.
 
 
How to use advanced table in oaf
Step3:- Now Right Click on the Region2(AdvancedTable) and click on the column.
 


Steps to create advanced table in oaf
 
Step4:-This new column1 has been created as below , under region2(advanced table).
When we created column under advanced table then automatically Column Header creates for each column of the Advanced table.
 
Steps to create advanced table in oaf
 
Step5:-Now again right Click on the Column1 and then Click New and Then Click Item.
This will create the Column of the First column. In this Column , we map the VO attribute which shows the data from the View Object  in the advanced table of the OAF Page,

 
How to use advanced table in oaf
 
 
Step6:- With the same steps we will create the Column2 as below.
How to use advanced table in oaf
 
 
In the Column Header , we can allow the sortable feature to the columns of the Advanced Table by which user can sort the data of the Advanced Table in the OAF Page.
 
How to use advanced table in oaf
 
 Right Click on the Column Header and select the sortableHeader to enable the sortable feature of Advanced Table Column.
 
How to use advanced table in oaf
 
 
Here below We have Create the Supplier Name headers as below.
 
How to use advanced table in oaf
 
Steps to create advanced table in oaf


Single selection in table region in oaf

Single selection in table region in oaf


Single Selection is the property of the OAF Advanced Table. This helps to control the selection of data in the Advanced Table region of the OAF Page. This component is used when you have a requirement that enables the user to select only one record (row) from a table. The idea is to "flag" the row attribute with a non-null value, to identify the selected row.

Steps to Enable Single Selection in the OAF Advanced Table

 
Right Click on the Region2(Advanced Table) Layout and Click New and Select SingleSelection.
 
 
Single selection in table region in oaf
 
Here below is the SingleSlection1 created as below.

 
Single selection in table region in oaf
 
Now we need to create the Bind Variable in your View Object (VO) , Click on the New Button.


Single selection in table region in oaf
Here below , We are creating the 'SingleSelectionV' attribute in your View Object.



Single selection in table region in oaf
 
Now again go back to the 'singleSelection1' in the AdvancedTable' region and go to its properties.
 
Single selection in table region in oaf
 
Set the Bind Variable 'SingleSelectionV' created in the VO to this SingleSelection properties of the Advanced Table Region.
 
 
Single selection in table region in oaf
 
 

Multiple selection in oaf

Multiple selection in oaf

Multiple Selection is the property of the Advanced Table region in the OAF. This helps to put controls on the selection of the data in the Advanced Table region in the OAF. When You want that user can select the multiple rows in the oaf page , then we need to set this property in the Advanced Table region of the OAF Page. With this option , we can delete the multiple rows and update the multiple rows together in the OAF Page.
 

How to set Multiple selection in OAF

Right Click on the Region2(Advanced Table) Layout and Click New and Select MultipleSelection..
 
Multiple selection in oaf
Here below is the MultipleSlection1 created as below.
 
Multiple selection in oaf
Now we need to create the Bind Variable in your View Object (VO) , Click on the New Button.
Here below , We are creating the 'MultiSelectionV' attribute in your View Object.
 
Multiple selection in oaf
 
Now again go back to the 'MultipleSelection1' in the AdvancedTable' region and go to its properties and set the Bind Variable created in the Last step 'MultiSelectionV' in the View Attribute.
 
Multiple selection in oaf
 
 
 
 

OAF advanced table single selection

OAF advanced table single selection

 
Single Selection is the property of the OAF Advanced Table. This helps to control the selection of data in the Advanced Table region of the OAF Page. This component is used when you have a requirement that enables the user to select only one record (row) from a table. The idea is to "flag" the row attribute with a non-null value, to identify the selected row.

Steps to Enable Single Selection in the OAF Advanced Table

 
Right Click on the Region2(Advanced Table) Layout and Click New and Select SingleSelection.
 
 
OAF advanced table single selection
 
Here below is the SingleSlection1 created as below.

 
OAF advanced table single selection
 
Now we need to create the Bind Variable in your View Object (VO) , Click on the New Button.

OAF advanced table single selection
Here below , We are creating the 'SingleSelectionV' attribute in your View Object.


OAF advanced table single selection
 
Now again go back to the 'singleSelection1' in the AdvancedTable' region and go to its properties.
 
OAF advanced table single selection
 
Set the Bind Variable 'SingleSelectionV' created in the VO to this SingleSelection properties of the Advanced Table Region.
 
 
OAF advanced table single selection
 
 
 

How to Enable Log messages in the Auto Invoice Import Program to see Errors.

How to Enable Log messages in the Auto Invoice Import Program to see Errors.

 
In This post , We will set the Option to enable the Log Messages in the Auto Invoice Import Program. When we got some error in the Auto Invoice Import program then to debug the issues then we need to set the value of Log File Message Level.
 
Go to the Receivables Manager responsibility.
Go to Setups and Select System Options.
 
How to Enable Log messages in the Auto Invoice Import Program to see Errors.
 
 
Set the Log File Message Level to 10 if you want to see the log of the program in detail.
How to Enable Log messages in the Auto Invoice Import Program to see Errors.
 

Advanced table features in oaf

Advanced table features in oaf

Advanced Table is the New region style in the OAF Framework which has many other features as compared to the Simple Table Layout region. Advanced Table provides better presentations of the data in the OAF page as compared to the Simple table region in oaf. Beside the graphical look , there are many others tools and add On features available in the Advanced table in OA framework.
 
1.In advanced table , we can create the Sortable header for each columns of the table. It means we can sort the data of the Table through its Table Column in the OAF Page.
2.In Advanced Table , we can create the Summary total in the footer of the Advanced Table. This is the Add on to create the Total in the footer of the Advanced Table.
3.In Advanced Table , We can create the Button to insert new row in the Table to insert data by the user in the OAF Page.
4.Advanced Table provides Multi Select and Single Select options by which if we can control the data selection in the Advanced table region .
 
For Example if we choose Single select then user can only select Single row in the table in OAF Page.
 
If we choose Multi Select then user can select multiple rows in the table region in OAF Page.
 
 
Text: This is the text that will be displayed on the top of the table once the OA Framework page is rendered.

Records Displayed: This property can limit the number of records that can be displayed on the screen once the advanced table is rendered. Be default the number of records displayed is 10.
Width: this is another important property of advanced table. Here as the name suggests you can enter the width of the table once the table is rendered.
Controller Class: This is an optional property. If you want to perform some runtime action then only you need to create a controller class where you will be handling the events and navigations performed on the advanced Table.
 
 
Advanced table features in oaf
 
 

what is MDS?

what is MDS?

MDS is MetaData Service. When a web page is broken into small units like buttons, fields etc. they are stored in a database. These are not stored as binary files but as data in tables. The data are present in JDR tables. MDS provides service to store & return page definitions. MDS collects those definitions in components/fields in a meaningful manner to build a page in OAF.

What is the difference between inline Lov and external Lov

What is the difference between inline Lov and external Lov

Inline and External Lov concept exists in the OA framework. There are two types of Lov's exists in the OA Framework and that is Inline Lov an External Lov.
 
Inline Lov:-
 
Inline lov is a lov which is used only for that particular page for which it was created and cannot be used by any other page.
 
External Lov:-
 
External lov is a common lov which can be used by any page. It is a common component for any page to use it. It can be used by giving the full path of the lov in the properties section “External LOV” of the item.
 
Here below we specifies the External LOV Path.
 
What is the difference between inline Lov and external Lov
 

Table region in oaf

Table region in oaf

In this post , I am sharing the steps to create advanced table in oaf page. Here below I have create the workspace 'XXAdvancedTable' under this workspace we have created the Project 'XXAdvancedTable'  . Under this project , we have created the Page 'XXAdvancedTable'.
 
Step1:- We have create the  'XXAdvancedTable' as below , under this page region We have created the new region with style 'Table'.

Table region in oaf is used to show the data in the Tabular form in OAF Page. This is the region style to show the data. We can also create this table region through wizard in the OAF. Table region shows the data in a very simple form. Here below I am showing the steps to create the Table region in OAF.
 

Steps to Create the Table Region in oaf

 Right Click on the Page region and click on the region as below. This will create the new region as below.
 
 
Table region in oaf
 
 
 
Step2:- Change the Region style 'Table' in the property inspector.
 
 
Table region in oaf
 
Step3:- Right Click on the Region2(Table) and select New and Then Select Item as below.
Now Item1 will be created. Change the Item1 name to  'SupplierName'.
Again Right Click on the Region2(Table) and select New and Then Select Item as below.
Now Item2 will be created. Change the Item2 name to  'SupplierNumber'.
 
Table region in oaf
 
 Step4:- Here below two columns has been created as below Supplier Name and Supplier Number.
 
In the Property , Select the VO Column attributes for Supplier Name and Supplier Number.
 
Table region in oaf
 
 
 

Steps to create advanced table in oaf

Steps to create advanced table in oaf

 
In this post , I am sharing the steps to create advanced table in oaf page. Here below I have create the workspace 'XXAdvancedTable' under this workspace we have created the Project 'XXAdvancedTable'  . Under this project , we have created the Page 'XXAdvancedTablePG'.
 
Step1:- We have create the  'XXAdvancedTablePG' as below , under this page region We have created the new region with style 'AdvancedTable'.
 
Right Click on the Page region and click on the region as below. This will create the new region as below.
 
 
Steps to create advanced table in oaf
 
 
Step2:- Change the Region style 'advancedTable' in the property inspector.
 
 
Steps to create advanced table in oaf
Step3:- Now Right Click on the Region2(AdvancedTable) and click on the column.
 


Steps to create advanced table in oaf
 
Step4:-This new column1 has been created as below , under region2(advanced table).
When we created column under advanced table then automatically Column Header creates for each column of the Advanced table.
 
Steps to create advanced table in oaf
 
Step5:-Now again right Click on the Column1 and then Click New and Then Click Item.
This will create the Column of the First column. In this Column , we map the VO attribute which shows the data from the View Object  in the advanced table of the OAF Page,

 
Steps to create advanced table in oaf
 
 
Step6:- With the same steps we will create the Column2 as below.
Steps to create advanced table in oaf
 
 
In the Column Header , we can allow the sortable feature to the columns of the Advanced Table by which user can sort the data of the Advanced Table in the OAF Page.
 
Steps to create advanced table in oaf
 
 Right Click on the Column Header and select the sortableHeader to enable the sortable feature of Advanced Table Column.
 
Steps to create advanced table in oaf
 
 
Here below We have Create the Supplier Name headers as below.
 
Steps to create advanced table in oaf
 
Steps to create advanced table in oaf


Create row in oaf

Create row in oaf

Create row is the method in OAF to create or insert news rows in the VO of the OAF Page. If we want to insert any row in the OAF page VO , then we must need to use 'createrow' object of OAF to convert the VO of OAF page in to Insert mode so that user can insert the record in the OAF page. To use the VO in OAF page we must need to assign that VO to the Application module(AM) of the page so we need to write the code to create row for the VO under the application module.
 

Here below I am sharing the code to create row in the OAF

 
Put the following code in the Application Module
 
  public void insertRecord()
   {
     OAViewObject vo = (OAViewObject)getInsertRecordXXTESTVO();
    
     if (!vo.isPreparedForExecution())
     {
           vo.executeQuery();
     }
    
     Row row = vo.createRow();
     vo.insertRow(row);
     row.setNewRowState(Row.STATUS_INITIALIZED);
   }
 
So we want when page load in the application then automatically , page should be in the Insert mode so for this we need to put the code under the Process Request method of the controller. Under this method , we are calling the 'insertrecord' to convert the Page in the Insert mode.
 
     if (!pageContext.isFormSubmission())
       {
        OAApplicationModule am = pageContext.getApplicationModule(webBean);
        am.invokeMethod("insertRecord", null);
       }
Create row in oaf
 
 

Friday 29 June 2018

Oracle callablestatement example in oaf

Oracle callablestatement example in oaf

Callablestatement helps to execute the PL/sql block from OAF page controller. We pass PL/SQL block as string paramters in the Callablestatment and callablestatement help to convert this sting in to an executable plsql block to exeute in the Oracle database.Callablestatement also helps to set the parameter for the block in the OAF page controller. If we are using , parameters in the PLSQL block and we are executing this block from
OAF controller then we also set the values in these parameters with the help of the callablestatement. Callablestatement also helps to get the output of the plsql block.
 
 
Here below I am sharing the examples of callablesstatement in oaf.
 
Example 1:- OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
 
OADBTransaction txn = am.getOADBTransaction();
 
String str="BEGIN xx_test_pkg.updaterecord(P_Header_id => :1);END;";
 
OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);

String Result = "";
Number localNumber;

try {
Callstmt.setString(1,RptHdrId);
Callstmt.execute();      
Callstmt.close();

 }
catch(SQLException sqle)
  {
paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        


Example2:-


OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
 
OADBTransaction txn = am.getOADBTransaction();
 
String str="BEGIN xx_test_pkg.updaterecord(P_Header_id => :1);END;";
 
OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);

String Result = "";
Number localNumber;

try {
Callstmt.setString(1,RptHdrId);
Callstmt.execute();      
Callstmt.close();

 }
catch(SQLException sqle)
  {
paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
 
Oracle callablestatement example in oaf
 

oadbtransactionimpl in oaf

oadbtransactionimpl in oaf

 
OADBTransaction in oaf is used perform data base operations in the OAF page controller. If we want to execute sql statements in the OAF page controller then we should create the handle of OADBTransaction and with this handle we can able to execute the sql statement in the OAF page. In the similar way , if we want to execute the PLSQL block or database procedures or function in the OAF page then we still need to use this OADBTransaction object of OA framework.
 
TO used OADBTransaction we first need to import its class in the oaf page controller to used in the   controller class file.
 
here below is the import class of OADBTransaction.        
 
import oracle.apps.fnd.framework.server.OADBTransaction; 
 
 

Example of using oadbtransactionimpl in oaf

 
 
Number rptHdrId;
rptHdrId = new Number(paramOAPageContext.getDecryptedParameter("ReportHeaderId"));
if (rptHdrId!=null)
Connection conn = paramOAPageContext.getApplicationModule(paramOAWebBean).getOADBTransaction().getJdbcConnection();
String Query = "SELECT NVL(expense_status_code,'NEW') status FROM ap_expense_report_headers_all WHERE report_header_id=TO_NUMBER(:1)";
 
PreparedStatement stmt = conn.prepareStatement(Query);
String RptHdrId = ""+rptHdrId;
stmt.setString(1,RptHdrId);
for(ResultSet resultset = stmt.executeQuery(); resultset.next();)
                                   {
  result = resultset.getString("status");
paramOAPageContext.writeDiagnostics(this, "comparison"+comparison,2);
 if("REJECTED".equals(result))
                                                {
Here below I will write the code to perform some action if we found expense report status ‘Rejected’
                                   }
}

oadbtransactionimpl in oaf
 
oadbtransactionimpl in oaf

Callablestatement in oaf

Callablestatement in oaf

 
Callablestatement helps to execute the PL/sql block from OAF page controller. We pass PL/SQL block as string paramters in the Callablestatment and callablestatement help to convert this sting in to an executable plsql block to exeute in the Oracle database.Callablestatement also helps to set the parameter for the block in the OAF page controller. If we are using , parameters in the PLSQL block and we are executing this block from
OAF controller then we also set the values in these parameters with the help of the callablestatement. Callablestatement also helps to get the output of the plsql block.
 
Here below I am sharing the sample code of callablestatement in oaf.
 

OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
 
OADBTransaction txn = am.getOADBTransaction();
 
String str="BEGIN xx_test_pkg.updaterecord(P_Header_id => :1);END;";
 
OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);

String Result = "";
Number localNumber;

try {
Callstmt.setString(1,RptHdrId);
Callstmt.execute();      
Callstmt.close();

 }
catch(SQLException sqle)
  {
paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
}

Callablestatement in oaf
 

How to call procedure from oaf page

How to call procedure from oaf page

In this post, I will share the code to call procedure from the OAF page. To call procedure from OAF , we need to create the controller of the page and then write the code in the controller to call procedure. With this code , we can directly execute the Data base procedure from the OAF controller directly. To execute Procedure from OAF page , we need to use OADBTransaction object of the OAF , which helps to execute the sql and procedure in Data base from OAF controller. Second important things we needs to execute procedure is OracleCallableStatement.You can call PL/SQL block from the OA Framework using callable statement.
 

Here below is the example to call procedure from OAF Page

 
 
OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
 
OADBTransaction txn = am.getOADBTransaction();
 
String str="BEGIN xx_test_pkg.updaterecord(P_Header_id => :1);END;";
 
OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);

String Result = "";
Number localNumber;

try {
Callstmt.setString(1,RptHdrId);
Callstmt.execute();      
Callstmt.close();

 }
catch(SQLException sqle)
  {
paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
}

How to execute sql statement in oaf controller

How to execute sql statement in oaf controller

 
 In this post , I will share the OAF code to execute Sql statements in the Controller. We often need this kind of things in the Controller to execute the Sql statements to do the comparison of the data on which we can write our custom code so this is quite common Requirment for OA framework developer. To execute the Sql statement from OAF controller first important thing we need Database connection so for this we first create the Handle in the OAF controller with OADBTranaction Bean. Then  to prepare the sql statement in controller the second important things we uses 'PreparedStatement' object of Controller. With this object , we can execute the sql statement in the DB from controller Environment.
 

Here below I am sharing the detail code to execute sql statement in OAF controller.

Number rptHdrId;
rptHdrId = new Number(paramOAPageContext.getDecryptedParameter("ReportHeaderId"));
if (rptHdrId!=null)
Connection conn = paramOAPageContext.getApplicationModule(paramOAWebBean).getOADBTransaction().getJdbcConnection();
String Query = "SELECT NVL(expense_status_code,'NEW') status FROM ap_expense_report_headers_all WHERE report_header_id=TO_NUMBER(:1)";
 
PreparedStatement stmt = conn.prepareStatement(Query);
String RptHdrId = ""+rptHdrId;
stmt.setString(1,RptHdrId);
for(ResultSet resultset = stmt.executeQuery(); resultset.next();)
                                   {
  result = resultset.getString("status");
paramOAPageContext.writeDiagnostics(this, "comparison"+comparison,2);
 if("REJECTED".equals(result))
                                                {
Here below I will write the code to perform some action if we found expense report status ‘Rejected’
                                   }
}
 
How to execute sql statement in oaf controller
 
 
 
 

Wednesday 27 June 2018

Page button bar in oaf

Page button bar in oaf

 
Page Button bar is the Specific Region Style for OAF buttons in the OAF page . Buttons created under this Region Style shows in the OAF Page in a specific Position of the OAF Page. This the separate region style of the buttons. This Region shows Button in the Top and Bottom of the right hand side of the page as below.
 
Here we can see I have create Button 'Save' under the Page Button Bar region style of the Page and now its showing as below in the Top and Bottom of the right hand side of the page.
 
Page button bar in oaf
 
 

How to Create Button in the Page Button Bar Region of the OAF Page.

 
Right Click on "PageLayoutRN".Click New.Click Region.
Page button bar in oaf

Region1 has created.
ID=PageButtons
Change the Region Style for region1 is "pageButtonBar".

Right Click on PageButtons Region.Click New.Click Item
Page button bar in oaf
 item1 has created under "PageButtons" region.
Change the item1 Property
ID=Save
Item Style=submitButton.
Page button bar in oaf
 
 

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

Name

Email *

Message *