Thursday, 30 July 2015

OAF: How to display Help link in custom OAF Page

Recently I saw a question in OTN Forum asking how to add the help link in custom OAF Page. Since I couldn't find much available for this, I am adding a post for achieving that.

Highlevel steps:

1. Create the .htm file (Need to have a specific structure as per the sample given below)
2. Upload the file using the Help Upload functionality.
3. Creating the target using Help Builder (I think this is optional if you are creating one help page alone)
4. Specify the Help Target for the PageLayoutRN of the Page.

Thanks to Chetan Gowda

1. Create the .htm file.


Create a .htm file with the structure similar to the sample one below:


Sample structure is given below:
 <HTML LANG="en-US" DIR="LTR">  
      <HEAD>   
           <TITLE>AJ Test Page </TITLE>   
           <LINK REL="stylesheet" HREF="../fnd/iHelp.css">  
      </HEAD>  
      <A NAME="FND_AJTEST_HLP_TestPG"></A>   
      <CENTER><H2><B>AJ Test Heading</B></H2></CENTER>   
      <H3><B>AJ Test Content</B></H3>   
      <BODY>  
           This is the help page for the AJ Test PG.  
      </BODY>  
 </HTML>  

Note:- <A NAME="FND_AJTEST_HLP_TestPG"></A>. This is used to specify the target. 

2. Upload the file using the Help Upload functionality.
Navigate to System Administration --> Help Administration --> Help Upload.

Specify the parameters as below :
     Action                        : Single File Upload
     Desktop File              : <Choose the .htm file created before> 
     Application                : FND  (Specify the application for which the file is getting created)
     Customization Level : 101 (anything above 100)


3. Creating the target using Help Builder.
Navigate to System Administration --> Help Administration --> Help Builder.  
     Create a new Node by clicking on the New Node icon.
  Prompt: AJ Test
  Data: @fnd_ajtest_hlp_testpg
  Node Application : FND

     Click on apply.
     Change the Type to 'Document' and click on 'Apply'. You can now click on the 'View' button to view the page.


4. Specify the Help Target for the PageLayoutRN of the Page.
Specify the Help Target Appl ShortName and the Help Target for the pageLayoutRN. Help Target Appl ShortName should be give as the application short name and the Help Target should be the one specified (FND_AJTEST_HLP_TestPG) in the anchor tag in the .htm file uploaded.



Now run the page(I was using 12.2.4 Jdev against 12.1.3 environment, so the screen shots looks bit different from the above images):
Click on the help link.



Have a look at the section "Oracle E-Business Siute Help" in the "System Administrator's Guide":
http://docs.oracle.com/cd/E18727_01/doc.121/e12893.pdf

Also refer the section "Help Global Button" in the Developer Guide:
Oracle Application Framework Developer's Guide Release 12.1.3 (Doc ID 1107973.1)


Feel free to point out if anything is missing/wrong in this blog.


Tuesday, 28 July 2015

Oracle Apps: How to delete a DFF Context

You cannot delete a DFF Context from the front-end. You can only disable it.
Assume you have created one by mistake and you want to delete that.How to do that ?
  • The segments added to the context can be deleted from the front-end. Delete those first.
  • You can use fnd_descr_flex_contexts_pkg.delete_row to delete the context.
 procedure DELETE_ROW (  
  X_APPLICATION_ID in NUMBER,  
  X_DESCRIPTIVE_FLEXFIELD_NAME in VARCHAR2,  
  X_DESCRIPTIVE_FLEX_CONTEXT_COD in VARCHAR2  
 );  

Ex:-


 begin  
  fnd_descr_flex_contexts_pkg.delete_row(0,'FND_COMMON_LOOKUPS','TEST');  
 end;  

You need to call commit after the above call.

Also make sure that you UnFreeze and Freeze the DFF definition and compile the DFF.

Script to check from backend whether it is deleted:
 select * from FND_DESCR_FLEX_COLUMN_USAGES where application_id = 0 and descriptive_flex_context_code = 'TEST';  
 select * from FND_DESCR_FLEX_COL_USAGE_TL  where application_id = 0 and descriptive_flex_context_code = 'TEST';  
 select * from FND_DESCR_FLEX_CONTEXTS      where application_id = 0 and descriptive_flex_context_code = 'TEST';  
 select * from FND_DESCR_FLEX_CONTEXTS_TL   where application_id = 0 and descriptive_flex_context_code = 'TEST';  

Related Links : Delete a Descriptive Flexfield Context Value


Feel free to point out if anything is missing/wrong in this blog.


Wednesday, 22 July 2015

Oracle Apps: How to set the required fields to Yellow color in Professional User Interface (Forms screens)

Recently I saw a thread in OTN which talks about the profile option FND: Indicator Colors which is used to set the coloring in the Forms screens. So thought of adding that to my post so that it will be useful for someone.

OTN Thread: Unable to see required/mandatory parameters in a Concurrent request

Reference: 
Oracle E-Business Suite Accessibility Features
Profile Options in Oracle Application Object Library

FND: Indicator Colors
The default for this profile option is null, which means "Yes." When this profile option is set to Yes:
  • Required fields are displayed in yellow.
  • Queryable fields are displayed in a different color while in enter-query mode.
  • Fields that cannot be entered (read-only) are rendered in dark gray.
Users can see and update this profile option.
LevelVisibleAllow Update
SiteNoNo
ApplicationNoNo
ResponsibilityNoNo
UserYesYes
The internal name for this profile option is FND_INDICATOR_COLORS.

When the profile option is set to 'No'.


When the profile is set to null or 'Yes'


This profile value also reflects on the Concurrent Request screens as shown in the above images.

Feel free to point out if anything is missing/wrong in this blog.

Thursday, 2 July 2015

OAF: How to add logging / debug messages in Oracle Application Framework

In this post I will explain how to write log / debug statements in Controller (CO), Application Module Implementation class(AM), ViewObject and ViewObject Row Implementation class (VO) and Entity Object Implementation class (EO) in OA Framework.

OA Framework has a method writeDiagnostics() which can be used from anywhere in the above mentioned classes. This methods are published by oracle.apps.fnd.framework.webui.OAPageContext and oracle.apps.fnd.framework.server.OADBTransaction (for example, if you want to make logging calls in a UI controller, use OAPageContext. If you want to make logging calls from an application module, use OADBTransaction).  Below give are the example to show how to call these methods in different places.



To view log mesages, select the Diagnostics global button from any page (this global button is configured as part of the standard global menu added to each page; the display of this menu item is controlled by the profile option FND: Diagnostics (FND_DIAGNOSTICS)) 

Diagnostics can be enabled at various levels:
  • Show Log - directs you to the Oracle Applications Manager where you can view a "snapshot" of your Oracle E-Business Suite system.
  • Show Log on Screen - allows you to specify a log level and display Java log messages for a particular HTTP Request-Response at the end of the current page. For additional information about this feature, refer to the section titled "Using Logging to Screen" in the Oracle Application Framework Developer's Guide chapter called How to Configure Logging of the Oracle E-Business Suite Supportability Guide, available on the Applications Release 12 Online Documentation CD.
  • Set Trace Level - displays the Set Trace page where you can specify the level of information to collect in a database trace. 
  • Show Pool Monitor - displays the Application Pool Monitor where you view different aspects of runtime and configuration information about the JVM.
Here we are discussing only about the option "Show Log on Screen".

The debug messages can be written in various level:

  • Statement (1)
  • Procedure(2)
  • Event(3)
  • Exception (4)
  • Error (5)
  • Unexpected(6)
Depends on which options you choose, the screen will display all the debug messges written on that level or above. I prefer to write the debug messages at the exception level, so if I select the option Exception(4) in the screen, i can see only my debug messages.(most of the standard logging statements are written at Statement(1) level.)
  • From a Controller
 if(pageContext.isLoggingEnabled(OAFwkConstants.EXCEPTION))  
 {  
      pageContext.writeDiagnostics(this,"[TestCO]processRequest():- <Log Message Here!!!!!!>",OAFwkConstants.EXCEPTION);  
 }  
  • From AM Impl class
 if(this.isLoggingEnabled(OAFwkConstants.EXCEPTION))   
 {  
      this.writeDiagnostics(this,"[TestAMImpl]testMethod():- <Log Message Here!!!!!!>",OAFwkConstants.EXCEPTION);  
 }  
  • From VOImpl class
 if(this.isLoggingEnabled(OAFwkConstants.EXCEPTION))   
 {  
      this.writeDiagnostics(this,"[TestVOImpl]testMethod():- <Log Message Here!!!!!!>",OAFwkConstants.EXCEPTION);  
 }  
  • From VORow Impl class
 import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;  
 OAApplicationModuleImpl appModule = (OAApplicationModuleImpl)this.getApplicationModule();  
 if(appModule.isLoggingEnabled(OAFwkConstants.EXCEPTION))   
 {  
      appModule.writeDiagnostics(this,"[TestVORowImpl]testMethod():- <Log Message Here!!!!!!>",OAFwkConstants.EXCEPTION);  
 }  
  • From EOImpl class
 import oracle.apps.fnd.framework.server.OADBTransaction;  
 OADBTransaction transaction = this.getOADBTransaction();  
 if(transaction.isLoggingEnabled(OAFwkConstants.EXCEPTION))   
 {  
      transaction.writeDiagnostics(this,"[TestEOImpl]testMethod():- <Log Message Here!!!!!!>",OAFwkConstants.EXCEPTION);  
 }  
If you are running from Jdeveloper, you could just use the SOP statements.
 System.out.println("[TestCO]processRequest():- <Error Message Here!!!!!!>");  

This is a custom method which I normally use, which is helpful when you want to change the debug levels. This is used in CO, if you want you can write something similar in AM :)
 public void writeLog(OAPageContext pageContext, String message)   
 {  
      if(pageContext.isLoggingEnabled(OAFwkConstants.EXCEPTION))  
      {  
           pageContext.writeDiagnostics(this,message,OAFwkConstants.EXCEPTION);  
      }  
      System.out.println(message);  
 }  


Related Links: Logging in OAF Pages – A Technical Note!



Feel free to point out if anything is missing/wrong in this blog.