Saturday, 31 March 2018

How to do VO Extension in OAF Through controller Extension: Add New column to Standard VO through Controller Extension

How to do VO Extension in OAF Through controller Extension: Add New column to Standard VO through Controller Extension

 
In this post , we will try to Do View Extension Through controller Extension. It means , we will add new column to the standard View Object , dynamically Through controller Extension. Some times its not  possible to do view extension in the Standard View Objects then we can use this approach and can do View Extension through controller Extension.
 
I will share you the Controller Code that how we can add new column to the standard view objects through controller Extension.
 
 
 
 public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    {   
super.processFormRequest(pageContext, webBean);
OAApplicationModue am= (OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject vo1=(OAViewObject)am.findViewObject("TrackExpenseReportsVO");
if (vo1 !=null)
{
vo1.addDynamicAttribute("XXTRACKINGNO");
}
vo1.reset();
vo1.next();
do
{
String RptHdrId   =Integer.parseInt(vo1.getCurrentRow().getAttribute(""ReportHeaderId").tostring());
Connection conn = paramOAPageContext.getApplicationModule(paramOAWebBean).getOADBTransaction().getJdbcConnection();
String Query = "SELECT ATTRIBUTE5 TRACKINGNO FROM ap_expense_report_headers_all WHERE report_header_id=TO_NUMBER(:1)";  
PreparedStatement stmt = conn.prepareStatement(Query);
stmt.setString(1,RptHdrId);
for(ResultSet resultset = stmt.executeQuery(); resultset.next();)
{
result = resultset.getString("status");;
  
}
 
String aString = result;
vo.getCurrentRow().setAttribute("XXTRACKINGNO",aString);
vo.next();
}
while (vo.hasNext());
vo.first();
 
/*XX_EXPENSE_TRACK_NO IS THE NEW ITEM CREATED THROUGH PERSONALIZATION IN THE VIEW OBJECT TrackExpenseReportsVO IN THE OAF PAGE */
 
How to do VO Extension in OAF Through controller Extension: Add New column to Standard VO through Controller Extension
 

OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("XX_EXPENSE_TRACK_NO");

mst.setViewUsageName("TrackExpenseReportsVO");
mst.setViewAttributeName("XXSalary");
 
}
 
 
 
How to do VO Extension in OAF Through controller Extension: Add New column to Standard VO through Controller Extension
 
 
 

1 comments:

Rainbow Training Institute said...

your blog is really informative and helpful for me @ Rainbow Training Institute.

Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
Oracle Fusion Financials Online Training
Oracle Integration Cloud Online Training
Oracle Fusion Technical Online Training

Post a Comment

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

Name

Email *

Message *