Monday 8 January 2018

Basics for Custom Form Development

The below are the steps to follow to develop a basic Custom form in EBS.

Download the Resource folder from the server and place in local directory.

Right Click on form builder--> Select properties --> In Start field : <resource folder path>

Creating Table:

Create table with who columns, flex field columns and Database Columns.

Registering Table and Columns:

When table contains flexfield columns or alert columns the table and columns need to be registered in the application.

Ad_dd is the API used to register table and columns.

Ex:
EXEC ad_dd.register_table (‘<Application short name>’, '<Table name>', '<Transaction Table-T>');
exec ad_dd.register_table ('SQLAP', 'DOY_TB_CUSTOMERS_DEFN_10418', 'T');

EXEC AD_DD.REGISTER_COLUMN ('<Application short name>', '<Table name>','<Column name>', <Sequence number of column>,’<Data type>', <Column Width>,'<Nullable>', '<Translatable>');

EXEC AD_DD.REGISTER_COLUMN ('SQLAP','DOY_TB_CUSTOMERS_DEFN_10418', 'CUSTOMER_ID', 1,'NUMBER',38, 'Y', 'N');
Note: Column width or Number -38 and for Date-9 if not specified.

Creating Main Form:

1. Download TEMPLATE.fmb and APPSTAND.fmb from server and place the files in resource folder.
2. Now open TEMPLATE.fmb in form builder and rename the file.
3. Remove the Defaults
                        >Open Oracle Forms Builder
                        >Open the form TEMPLATE.fmb
                        >Rename the form (ex XX_abcd1)
                        >Delete the followings from object nevigator.
                                    >Go to Data Blocks and delete BLOCKNAME, DETAILBLOCK
                                    >Go to Windows and delete BLOCKNAME
                                    >Go to Canvases and delete BLOCKNAME
4. Create new window,canvas and data block.
5. Modify the PRE-FORM Trigger
                        >Go to triggers—PREFORM
                        >Original Code:

FND_STANDARD.FORM_INFO(‘$Revision: 120.0 $’, ‘Template Form’, ‘FND’,
‘$Date: 2005/05/06 23:25  $’, ‘$Author: appldev $’);
 app_standard.event(‘PRE-FORM’);
 app_window.set_window_position(‘BLOCKNAME’, ‘FIRST_WINDOW’);
                       
                        >Modified Code:
                       
   FND_STANDARD.FORM_INFO('$Revision: 1.0 $', 'XXCUST_10418','CUST_FORM_10418',
  '$Date: 2017/03/23 11:00  $', '$Author: Gayathri $');
  app_standard.event('PRE-FORM');
  app_window.set_window_position('CUSTOMERS', 'FIRST_WINDOW');                       
                        > Compile the code
6. Modification for Program unit
                        > Go to APP_CUSTOM*(Package Body)
                        >Type your First window name in place of <your first window>
                        > Compile the code
7. If any Item in the Datablock is of Date type and you want to attach a standard calender to it, do the following
                        > Go to Text Item> Property palate > Subclass Information > Property Class
                        > Give property class name as TEXT_ITEM_DATE
                        > Attach LOV as ENABLE_LIST_LAMP
                        > Create KEY-LISTVAL item level trigger & add following code into it
                           calendar.show; and compile the trigger.


Compiling & Registering Form :

1. Deploy .fmb file in the server in AU_TOP/version/forms/US
2. Compile the fmb file in putty using below steps
A) cd appl_top
B) find *.env
C) . ./<First environment variable ex: APPSUAT_ebs12training.env>
D) cd au_top/version/forms/US
E) frmcmp_batch userid=apps/apps module=<form name>.fmb output_file=CUST_TOP/version/forms/US/<form name>.fmx module_type=form batch=no compile_all=special
F) Now register form under Application Developer -> Application -> Form
G) Register Function System Administrator —>Application —> Function
H) Register Menu and Responsibility.


Assigning WHO Columns :

1. Apply the CREATION_OR_LAST_UPDATE_DATE property class to the form fields CREATION_DATE and LAST_UPDATE_DATE. This property classes sets the correct attribute values like data type and width.
2. Create PRE_INSERT AND PRE_UPDATE triggers under datablock with
   fnd_standard.set_who();


Creating QUERY_FND form:

1. Drag QUERY_FIND Object Group from APPSTAND.fmb to Our Form Object Group. Here we get  window,canvas,datablock will come automatically  with the name QUERY_FIND.
2. Apply subclass information to QUERY_FND Window,Canvas as well as Block. And drag these to first position.
3. In QUERY_FIND data block we get 3 buttons(Clear,New,Find) with 3 Triggers.
4. Give Block name as <main forms data block name> in WHEN-BUTTON-PRESSED trigger of New and Find Button. Compile and close.
5. Open the QUERY_FND canvas and create test items.
6. Next drag the QUERY_FIND trigger from APPSTAND.fmb and Place it in Main forms data block level trigger.
--APP_STANDARD.EVENT('QUERY_FIND');
APP_FIND.QUERY_FIND(<results block window>, <Find window>, <Find window block>);
Ex:
APP_FIND.QUERY_FIND('CUSTOMERS','QUERY_FIND','QUERY_FIND');
7. Create pre_query trigger in main forms block
IF :parameter.G_query_find = 'TRUE' THEN
COPY (<find Window field>,<results field>);
Ex: COPY(:QUERY_FIND.customer_id, 'customers.customer_id');
:parameter.G_query_find := 'FALSE';
END IF;
8. In the form module give the first navigation block as QUERY_FIND. In the QUERY_FIND datablock give next navigation block as MAIN DATA BLOCK.
9. Save and move to server.

No comments:

Post a Comment