How To Change VO Query in OAF
We can change the VO query in Oracle Apps by two ways, It
depends on our requirement what we want to change in the VO, We want to add new
column in the VO query then that
requirement will be handled through VO Extension in the OAF. We need to do the
View Extension for this Requirment, In this We first download the Standard VO
which we want to change from Application Java_Top and then in the J-Developer,
we substitute this Standard View Object with the New VO created in the
J-Developer. To get in detail how we can do the VO extension then. The second
way to Change VO query in Oaf is this, if we have the requirement to change
only the where condition of the View Object query, then in this requirement ,
where we don’t want to add new column in the View Object but only wants to
change the Where condition of the VO sql query then we can do this through by
Controller Extension , in which under the Controller we can write this below
code to change the VO query in OAF through runtime.
String query = "SELECT
A1.SUPPLIER_NAME,A2.SITE_CODE"+"FROM AP_SUPPLIERS A1,
AP_SUPPLIER_SITES_ALL A2" +"WHERE
A1.SUPPLIER_ID=A2.SUPPLIER_ID";
try
{
OAApplicationModule oam = pageContext.getApplicationModule(webBean);
OAViewObject vo
= (OAViewObject)oam.findViewObject("XXSUPVO");
vo.setFullSqlMode(vo.FULLSQL_MODE_AUGMENTATION);
vo.setQuery(query);
// setQuery
only sets the new query to the View Object, in order to effect the changes of
the query we need to execute the equery using below statement.
vo.executeQuery();
}
catch
(Exception e)
{
null;
}
0 comments:
Post a Comment