Total Pageviews

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

Friday, July 8, 2011

Call Procedure in OAF (1 input, 1 output parameter)

            String sql = "BEGIN xx_custom_pkg.custom_prc (:1,:2); END;";
            try {
                OracleCallableStatement cs =
                    (OracleCallableStatement)oam.getOADBTransaction().createCallableStatement(sql,
                                                                                              2);
                ((OracleCallableStatement)cs.registerOutParameter(2,
                                                                  Types.VARCHAR,
                                                                  0, 2000));
                cs.setString(1, xxAttribute1Value);
                cs.execute();
                String outParamValue = cs.getString(1);
                pageContext.writeDiagnostics(this,
                                             "Result is:" + outParamValue,
                                             OAFwkConstants.PROCEDURE);
                cs.close();
            } catch (Exception ex) {
                pageContext.writeDiagnostics(this, "Error:" + ex.toString(),
                                             OAFwkConstants.PROCEDURE);
            }

Wednesday, July 6, 2011

Call Procedure in OAF (2 input parameters)

Call a custom procedure. Two input parameters of type Varchar:
 OAApplicationModule oam =  pageContext.getApplicationModule(webBean);

 String sql =  "BEGIN xx_custom_pkg.custom_prc (:1,:2); END;";
                    try {
                        OracleCallableStatement cs =
                            (OracleCallableStatement)oam.getOADBTransaction().createCallableStatement(sql,
                                                                                                      2);
                        cs.setString(1, xxAttribute1Value);
                        cs.setString(2, xxAttribute2Value);
                        cs.execute();
                        cs.close();
                      }
                 catch (Exception ex) {
                        pageContext.writeDiagnostics(this,
                                                     "Error:" + ex.toString(),
                                                     OAFwkConstants.PROCEDURE);
                    }

Call Function in OAF

The segment below calls a custom function with 1 input parameter of type Varchar and returns a Varchar :

   OAApplicationModule oam = pageContext.getApplicationModule(webBean);  

   String sql =   "BEGIN :1 := xx_custom_pkg.call_custom_function (:2); END;";

  OracleCallableStatement cs =
                            (OracleCallableStatement)oam.getOADBTransaction().createCallableStatement(sql,2);

                        try {
                             //Register your function output...
                            cs.registerOutParameter(1, Types.VARCHAR, 0, 2000);
                            //Your input parameter below...
                            cs.setString(2, LinesRow.getAttribute("ReportLineId").toString());
                            cs.execute();
                            String p_res = cs.getString(1);
                            cs.close();       
                            }
                        catch (Exception ex) {
                                        pageContext.writeDiagnostics(this,
                                                                     "Error:" + ex.toString(),
                                                                     OAFwkConstants.PROCEDURE);
                           }                    

Create Tip Messages

Personalize the page:
The output will look like:





Second type of Tip Message:
And the output:

Tuesday, July 5, 2011

Returns a date string in the users date format

 /*
     * Returns a date string in the users date format
     *
     * @param nlsServ instance of OANLSServices
     * @param dateStr string in 'dd-mm-yyyy' format
     */
    public static String stringToDateString(OANLSServices nlsServ, String dateStr) {

      if (dateStr != null && !dateStr.equals(""))
      {
        Date date = null;
        if (databaseDateFormat != null) {
          try {
            date = databaseDateFormat.parse(dateStr);
          } catch (ParseException e) {
          }
        }

        if (date != null)
          return nlsServ.dateToString(date);
      }

      return null;
    }

Tuesday, June 14, 2011

Find a specific VO in AM.txt

            OAApplicationModule rootAM = pageContext.getRootApplicationModule();
           
            OAApplicationModule CompAM =
                 (OAApplicationModule)rootAM.findApplicationModule("BiddersListsAM");                                        

            OAViewObject BidVO =
                (OAViewObject)CompAM.findViewObject("BiddersListsVO");

            if (BidVO!= null) {
           
                Row BidRow = BidVO.getCurrentRow();
               
                   if (BidRow!=null) {
            
                   }
           
            }

Thursday, June 2, 2011

Show Error Message (using fnd messages)

This line requires you to create a custom message using Application Developer responsibility.
In this way your error message will be language specific.

throw new OAException("XXX", "XXX_READ_CUSTOM_MSG", null, OAException.ERROR, null);

Wednesday, June 1, 2011

Oracle Applications Framework Profiles

       Profile Name :Personalize Self-Service Defn
– Yes enables personalization link on all pages..This should be no in Production environment. For development team also it is better to set it yes at the user level
       Profile Name: FND: Personalization Region Link Enabled
– Yes displays all regional links
– Minimal displays key regional links
It is better to set the personalize link at the region level
       Profile Name :Disable Self-Service Personal
– Turn off all personalization
       Profile Name: FND: Personalization Document Root Path
– Used for importing/exporting personalization
       Profile Name: FND: Diagnostics
– Enables diagnostics on top right corner of the page

Populate Current Date and Time in OAF

OAApplicationModule am = pageContext.getApplicationModule(webBean);
SimpleDateFormat f = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String dateString = am.getOADBTransaction().getCurrentDBDate().toString();

java.sql.Date sqlDate= new Date(f.parse(dateString).getTime());

OAMessageDateFieldBean dateField =(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("currentDate");

dateField.setValue(pageContext,sqlDate);

How To Generate A SQL Trace In OAF


You can refer to Metalink note ID 357597.1
 
1. Set profile 'FND: Diagnostics' to Yes at user level.
2. Login to Personal Home Page as that user and select the 'Diagnostics' icon at the top of the page.
3. Select `Set Trace Level? and click Go
4. Select the desired trace level and click Save
5. Write down the trace id number(s).
6. Perform the activity that you want to trace
7. Return to the 'Diagnostics' page.
8. Select `Set Trace Level' and click Go
9. Select 'Disable Trace' and click Go.
10. Write down the trace id number(s) if different.
11. Go to user_dump_dest for your database and collect the raw trace file(s)
      suffixes by the trace id number(s) you have recorded.
12. Exit Applications.
Note: you can identify the user_dump_dest directory in your environment by running the following SQL:
SQL> select name, value from v$parameter where name like 'user%';

Find the correct version of JDeveloper

In order to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x,

you should refer to metalink note with ID 416708.1

For example, for Release 12.1 :

ATG Release 12.1 Version JDeveloper 10g Patch
12.1 (Controlled Release - only included for completeness) Patch 7315332 10G Jdev with OA Extension ARU for R12.1 (Controlled Release)
12.1.1 (rapidInstall or patch 7303030) Patch 8431482 10G Jdeveloper with OA Extension ARU for R12.1.1
12.1.2 (patch 7303033 or patch 7651091) Patch 9172975 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.2
12.1.3 (patch 9239090 or patch 8919491) Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3
12.1.3.1 (patch 11894708) Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3