Sunday, December 26, 2010

Building Screen from Scratch for Apps and some related questions

Question : what are the steps for building a screen from scratch?
Answer: Below steps in brief
A) Open up TEMPLATE.fmb, and save this as XXHELLOAPPS.fmb
B) Create a new window, by right clicking on Window/new
Name this window as XXHELLOAPPS,and assign it SubClass Type “WINDOW” from picklist.
C) Create a new canvas and name it XXHELLOAPPS , ensuring its Sublcass Type is “Content”
D) Make the windows property reference canvas XXHELLOAPPS and vice versa make the canvas reference windows XXHELLOAPPS.
E) Now create a block named XXHELLOAPPS . Lets keep this a control block for simplicity.
F) go to form level property, and set first navigation block to XXHELLOAPPS.
G) Add a label and a field named “Hello_World” to this block.
H) Generate the form on PC using Control-T keystrokes. This will ensure that nothing critical has been missed out.
I)  FTP the form file to $XXPO_TOP/forms/US
Surely, this XX will be replaced by the naming convention at your client/company.
J)  cd to  $XXPO_TOP/forms/US
And f60gen on XXHELLOAPPS.fmb
This will create a file executable as XXHELLOAPPS.fmx
K) Go to Application Developer responsibility
Menu /applicaton/form
Register the form
L) Register the Forms Function
This forms function must be registered against application "XX Purchasing".
M) Now add a menu item so that this forms function becomes available to specific responsibility.

Thats it, you will be able to open up this form from the responsibility.

Now some important notes:-
1. If you have a table based block, and if that block has some description type fields, then try not to fetch them from post query trigger. Instead, develop a view in apps schema and assign that view as base tale to this block. This has a benefit that users will be able to query on the description field if need be. Indeed you will need to do dml on the actual table yourself by overriding on-insert, on-update, on-delete and on-lock triggers.
2. For each block in the screen, create a form level package spec and package body. Your triggers in the block/block fields will make calls to that package.
3. Try not to do to much pl/sql within the form. Always do such database intensive operations in a database level package.
4. Try not using global variables, unless really needed. Give preference to the creation of form package variables.
5. In a multi record block, always add a field for Current Record Indicator.

Question: Is it a common practice to modify forms in Oracle Apps?
Answer: Yes and No.
Yes because you often will be called upon to modify the forms, but no because most often you should modify the screen without actually modifying the underlying forms executable .
Question: How can I modify screen without modifying the underlying executable ?
Answer: There are two ways, listed in the order of preferences:-
1. Forms Personalizations
2. CUSTOM.pll
Question: How does forms personalization work?
Answer: Oracle forms has triggers that we trap to write our business logic. Oracle has a standard practice of calling a generic piece of code from each trigger(at form level).  In this generic piece of code Oracle checks in personalizations tables to see if anything extra needs to be done for the events being executed.

Question: Fine then, but why is CUSTOM.pLL needed when we already have forms personalization?
Answer: Well just like any technology, forms personalization has its limitations.

Limitation example 1 of forms personalizations
---------------------------------------------------
For example you wish to prompt a message to user DO YOU WISH TO CREATE THIS PERSON AS SUPPLIER OR CUSTOMER OR EMPLOYEE. Lets say this message will prompt three options, create customer , create supplier or create vendor. Depending upon what user selects, you wish to navigate to one of relevant screens from the current TCA screen. For this, you have no choice but to use CUSTOM.pll

Limitation example 2 of forms personalizations
---------------------------------------------------
For example you wish to change the record group of a LOV, via changing its query, in a screen.  This can be done by CUSTOM.pll, but not by forms personalization.
Question: What about CUSTOM.pll, what can't be done via custom.pll ??  Hence calling for forms customization.
Answer: For example, you need to add a complete new section to the screen at a very specific location, this must be done via forms customization.

Question: how to identify the form executable?
Answer: There are two ways.
Method1
Open the form to be customized in Oracle Apps from respective Responsibility/Menu
Next select menu /Help/About Oracle Application.
Here, scroll down within the subwindow and search for fmx. This is the executable that oracle application runs when specific form is invoked.

Method2
Query the responsibility definition which has the form attached to this. Note down the Menu which is attached to Responsibility. Go to the menu definition screen and find the form function attached to this menu. From this form function find the form attached to this function.

Question:  what is the command for f60gen (change if window env)
Answer:
FORMS60_PATH=$FORMS60_PATH:$AU_TOP/forms/US
export FORMS60_PATH
cd $XXPO_TOP/forms/US
f60gen module=XXPOENTRY.fmb userid=apps/apps module_type=form batch=no compile_all=special

2 comments:

  1. Assalam Alikum Inam Ullah Bukhari

    Very Nice post i am a keen reader of your post.
    It seems you have stoped your good practise. Please keep blogging.


    Ghufran Ahmed Khan

    ReplyDelete
  2. Wassalam , thanks , actually now a days busy with the Oracle RAC related activities so posting on my other blog dbmentors.blogspot.com is being updated now a days.

    ReplyDelete