Search

Showing posts with label OA Framework. Show all posts
Showing posts with label OA Framework. Show all posts

Friday, May 21, 2010

Dynamic OA Personalization using FormFunctions

Requirement: Hiding a field in an OA page based on the responsibility from which the page was opened. For example, consider hiding the ‘Start Action’ column in Payment Process Requests Tab (Navigation: AP Super User > Payments > Payments Manager > Payment Process Requests Tab)

image

 

Option-1:

  • At the responsibility level, set the rendered property to false.
  • Drawback:
    • We need to hide the column for multiple responsibilities. Hence, we need to open the same OA page in different responsibilities and then, hide the column using OA personalization

 

Option-2: Very apt if all the responsibilities where the column is to be hidden use the same menu. This tutorial is about option-2

  1. Create a new Form Function of ‘UnknownType’
  2. Find the name of the menu being used for accessing the OA page
  3. Query for the menu and add the new form function created above in Step-1 and select the ‘Grant’ checkbox
  4. Go to the OA page that needs to be personalized and select the column that needs to be shown/hidden for personalization. In the rendered property at the site level enter the SPEL expression as ‘${oa.FunctionSecurity.<functionName>}’
  5. This means if the menu has the above created function with ‘Grant’ checkbox checked, then the column gets displayed; otherwise the column remains hidden

Detailed Steps to follow:

  • Create a new Form Function

image

 

image

 

  • Query for the responsibility and then copy the name of menu that is being used

image

  • Query for the Menu AP_NAVIGATE_GUI12 and add the form-function created in the first steps. The Grant checkbox will decide whether the column on the OA page will be displayed or not. If the Grant checkbox is selected, then the column will be displayed. If the Grant checkbox is not selected, then the column will be hidden.

image

  • Now go to the OA page (Navigation: AP Super User > Payments > Payments Manager > Payment Process Requests Tab)
image
 
  • Click on “Personalize Page”

image

  • Click on the Update icon (Pencil Icon) for the item “Column: (ActionSwitcherCol)” to view the below page. Now for the Rendered property, at the site level, select ‘SPEL’ from the poplist and then in the textbox next to it, enter ‘${oa.FunctionSecurity.XX_CARE_TEST}’ and click on ‘Apply’

image

  • Now, go back to the Menu form and query for the Menu. De-select the Grant checkbox and save to hide the ‘Start Action’ column

image

  • We observe that the ‘Start Action’ column is hidden
image
 
***** End of Exercise! :) *****

Wednesday, July 29, 2009

Data Load

Data Load is a convenient tool used for loading data into Oracle Apps forms. It has a look of a spreadsheet where we can put in commands or data and that data will get pasted into the selected Window (Oracle Apps Window etc.) and the commands will get executed in that window.

Data loader commands:
TAB: Tab
ENT: Enter
*UP: Up Arrow

*DN: Down Arrow

*LT: Left Arrow

*RT: Right Arrow

*SP: Save & Proceed

*FE: Field Editor
*PB: Previous Block
*NB: Next Block
*PF: Previous Field
*NF: Next Field
*PR: Previous Record
*NR: Next Record
*ER: Erase Record
*DR: Delete Record
*FR: First Record
*LR: Last Record
*SAVE: Save Record

*SB: Send a single space character
*ST: Select entire field text.
*SLN or *SL(N): Pause for N seconds.

*BM: Block Menu
*AX: Alt + X where X is a single letter (A-Z).
*FI: Find
*FA: Find All
*QE: Query Enter
*QR: Query Run
*CL: Clear Field
*IR: Insert record
*CW(window): Change to window window.
*ML(coordinates): Position the mouse at coordinates and press the left button.
*MR(coordinates): Position the mouse at coordinates and press the right button.
*CW(window): Make window the new target window for DataLoad.
*DL(coordinates): Position the mouse at coordinates and double click the left button.
PROMPT(message): Prompt the user with message and wait for a response.

Auto Tab

The auto tab check box enables automatic tabbing while working in Copy & Paste mode. When Auto Tab is used the "TAB" command can be omitted from the grid and DataLoad will automatically send a TAB command after each data cell has been sent.



Exercises:
  • Though dataload is used for inputting or updating the data in Oracle, the first two exercises are used to deal with querying the data. It is just to familiarize the user how F11 and Ctrl+F11 are done in Data Load
  • Exercise-3 deals with creating a new item based on an existing item
  • Exercise-4 is an attempt to use dataload on an OA page that performs Move Immediate functionality



Exercise-1: To query for ‘57ER%’ in “OPM Item Master” using dataload file
In Oracle Apps,
  • we open “OPM Item Master”,
  • do ‘F11’ and
  • then type “57ER%’ in Item field and
  • then do ‘Ctrl+F11’

In Data Load file,

  • *QE is for “Query Enter” or F11
  • *QR is for “Query Run” or ‘Ctrl+F11’
  • In case we need to sleep, use *SL(N) where N is number of seconds. For example, to sleep for 5 secs, we use *SL(5)

Exercise-2: To query for all FGLM items in “OPM Item Master” using dataload file
In Oracle Apps,
  • we open “OPM Item Master”,
  • do ‘F11’ and
  • then type ‘FGLM’ in Warehouse Item field and
  • then do ‘Ctrl+F11’

In Data Load file,

  • *QE is for “Query Enter” or F11
  • *QR is for “Query Run” or ‘Ctrl+F11’
  • In case we need to sleep, use *SL(N) where N is number of seconds. For example, to sleep for 5 secs, we use *SL(5)
  • TAB is used for going to the next field


Exercise-3: To create a new record in “OPM Item Master” by copying from “57ER%A” record
In Oracle Apps,
  • we open “OPM Item Master”,
  • do ‘F11’ and
  • then type ‘57ER%A’ in Item field and
  • then do ‘Ctrl+F11’
  • then File->New or click on the green plus button on the Buttons Bar
  • Go to Edit->Duplicate->Record Above
  • Change the item number and its description
  • And finally Save it
  • The UOM conversions page automatically opens and we close that window

In Data Load file,

  • *QE is for “Query Enter” or F11
  • *QR is for “Query Run” or ‘Ctrl+F11’
  • In case we need to sleep, use *SL(N) where N is number of seconds. For example, to sleep for 5 secs, we use *SL(5)
  • TAB is used for going to the next field
  • *IR is to insert a new record
  • *DN is for pressing DOWN Arrow
  • *UP is for pressing UP Arrow
  • *RT is for pressing RIGHT arrow
  • ENT is for hitting the ENTER key
  • *SAVE is for saving. (*SP is for SAVE and PROCEED. This command saves the record and clear all the fields for entering new record)
  • *AE is for Alt+E, *AF is for Alt+F
  • TAB is for tabbing to the nest field

Exercise-4: To move the sublots in QCH to SCL using Inspection Disposition form (Tempel Steel Project) through Data Loader

In Inspection Disposition OA page,

  • By default, the cursor is in the “Scan Sublot” field
  • The “ADD” button has shortcut “Alt+A”
  • The “SUBMIT” button has shortcut “Alt+S”
  • When we enter sublot and do “Alt+A”, the sublot gets added to the table region
  • Now we need to change the Location to SCL, lot status to GOOD and let the quantity remain as it is and remove the reason code. To delete the reason code, we simply enter a single-space and tab out
  • Finally, we need to hit “Alt+S” or SUBMIT button to do the Move Immediate
In Data Load File,
  • *AA is for “Alt+A”
  • *AS is for “Alt+S”
  • *SP is for single space
  • TAB is for tabbing out to the next field
  • *SL(7) is to sleep for 7secs

More exercises are in the making...! Happy Data Loading! :)

Sunday, April 27, 2008

Bundled Messages in OA page, the solution

Thanks to Manoj.. Or Should I say, Lalith :-)
I found the solution to the problem.
The Solution:
1) Import the following Java classes
import com.sun.java.util.collections.ArrayList;
import oracle.apps.fnd.framework.OAException;

2) Create the following methods in the AMImpl.java file:
private void addToBundle(Exception ex)
{
ArrayList a = (ArrayList)getOADBTransaction().getTransientValue("BUNDLEDEXCEPTION");
if (a == null)
a = new ArrayList();
a.add(ex);
getOADBTransaction().putTransientValue("BUNDLEDEXCEPTION",a);
}

public void showBundledMsg()
{
ArrayList a = (ArrayList)getOADBTransaction().getTransientValue("BUNDLEDEXCEPTION");
getOADBTransaction().putTransientValue("BUNDLEDEXCEPTION",null);
if( a != null)
{
throw OAException.getBundledOAException(a);
}
}

3) Usage in AM methods:
Whenever there is a validation error, instead of doing a "throw new OAException()", do a "addToBundle(new OAException());". Also use a boolean flag say "showMsg" and set it to true whenever a validation error occurs.

if(SomeValidationError)
{
OAException msg = new OAException("XXTMG", "XXTMG_PV_VALID_FULLSKIDQTY", null,OAException.ERROR,null);
addToBundle(msg);
showMsg=true;
}

Finally when all the checking for validations is done, cheack the value of "showMsg". If it is true, call the "showBundledMsg" AM method
if(showMsg)//Some of the values entered into the OA page are incorrect
{
showBundledMsg();
showMsg=false;
}

Well, that solves our problem! :-)

Friday, April 25, 2008

Bundled Messages in OA page

Problem:
Suppose an OA page has three fields:RollNo, Name, Rank and a Submit button.
The form requires the following validations:
1) RollNo should be an integer
2) Name should be a string
3) Rank should be an integer.

When Submit button is clicked, the code in the controller is called. Here we first check the value in RollNo field, throw an Exception if it has an invalid value. Then we verify the Name field and throw an OAException, if an invalid Name is entered and lastly we validate the Rank field for invalid entry.

Suppose the user has entered wrong value into all of the fields. When he/she clicks on Submit button, then first the error message related to the RollNo field is displayed ("RollNo has to be an integer. Please enter an integer in the RollNo field.") The user enters an integer to the RollNo field and hits on Submit.

Again he sees the error related to the name field ("Name has to be a valid String. Please enter characters only into the Name field") He does accordingly and hit submit for another time.

Another error message is displayed. This time, it is related to the Rank field on the OA page.

Instead of making the user hit Submit three times, is there a way in which we can display all the error messages in one go?!

Solution:
Thanks to Manoj.. Or Should I say, Lalith :-)

I found the solution to the problem.Will post it soon! :-)