Saturday, February 6, 2010

Custom Form Creation

what are the steps for building a screen from scratch?

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

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.


-Badma

Edit CUSTOM.pll

To convert from CUSTOM.pll to CUSTOM.pld
f60gen module_type=LIBRARY module=CUSTOM script=YES userid=apps/apps

To convert back from CUSTOM.pld to CUSTOM.pll ( after having edited the text pld file )
f60gen module_type=LIBRARY module=CUSTOM parse=YES userid=apps/apps

To convert from CUSTOM.pll to CUSTOM.plx
f60gen module_type=LIBRARY module=CUSTOM userid=apps/apps