Total Pageviews

Monday, December 19, 2011

User Profile Options

With the following query, you can list all the profile options assigned to a particular user:

select vl.profile_option_name,tl.user_profile_option_name,val.profile_option_value
from fnd_profile_options vl,fnd_profile_option_values val,fnd_profile_options_tl tl
where vl.PROFILE_OPTION_ID = val.profile_option_id
and tl.language = 'US'
and tl.profile_option_name = vl.profile_option_name
and val.level_value = (select user_id from fnd_user where user_name = 'ORACLE')
order by vl.profile_option_name;

Wednesday, July 13, 2011

Add Processing Page Access to Launching Page

In the page that initiates the long-running process, add code to instantiate and navigate to the processing page
as shown in the example below.  (Taken from Oracle Developers Guide)

import oracle.apps.fnd.framework.webui.OAProcessingPage;

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
   super.processFormRequest(pageContext, webBean); 

   // This example assumes a submit button named "StartProcess" initiates the long-running process.
   if (pageContext.getParameter("StartProcess")!= null) 
   {
     // Create the processing page and pass it the fully qualified name of the controller that
     // you created to launch the process.
     OAProcessingPage page =  new
OAProcessingPage("oracle.apps.fnd.toolbox.samplelib.webui.processCO");

     // The concise message is displayed in bold and should briefly describe the process.
     // NOTE: never hard-code text display values as shown here.  Always use message dictionary.     
     page.setConciseMessage("This is the concise processing page message.");

     // The detailed message displays below the concise message in plain text.  It provides
     // additional information about what's happening.
     page.setDetailedMessage("This is the detailed message which should explain what's happening.");

     // This is displayed in the processing page title.
     page.setProcessName("<Process Name>");

     // Forward to the processing page.  Note that the OA Framework assumes you
   //  are retaining  the root application module.  Since we haven't specified a different root AM on
     // the processing page, the OA Framework assumes it uses the same root AM as the launching page.
     pageContext.forwardToProcessingPage(page); 
   }
}

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