Wednesday, February 5, 2014

How to develop a new form for Oracle Applications / Forms Customization

To develop a new custom form for Oracle Applications the following steps have to be followed.
Step 1: Open TEMPLATE.fmb

Open Forms Builder (For Oracle Apps 11i it is Forms 6i and for Oracle Apps r12 it is Forms 10g)
If the Forms Builder library path is set as the previous article, open the file TEMPLATE.fmb. This file will reside in the same directory as the library files if you have downloaded all the library files from the server.

Step 2: Change the form name and Title

Open the properties of the form. Double click on the form name to bring up the properties. Change the Name and Title properties.

Step 3: Change the form name in PRE-FORM trigger

We shall first add  the version, author name and date of the form by changing,
1
2
FND_STANDARD.FORM_INFO('$Revision: 115.12                                                                                                                                             $', 'Template Form', 'FND',
                       '$Date: 2003/12/19 11:02  $', '$Author: appldev $');
to
1
2
FND_STANDARD.FORM_INFO('$Revision: 115.12                                                                                                                                             $', 'Template Form', 'FND',
                       '$Date: 2012/08/13 11:02  $', '$Author: Ray $');
This is done so that we can get this information by using the strings <form name>.fmb command in unix to view the form creation/modification information.
Change the following line,
1
app_window.set_window_position('BLOCKNAME', 'BLOCKNAME');
to
1
app_window.set_window_position('NEW_WINDOW', 'FIRST_WINDOW');

Step 4: Create a new data block

Create a new data block either manually adding or by using the wizard

Step 5: Create a new canvas.

You can use the wizard or create the canvas manually. The canvas we created is named
The canvas looks like this,
If you created the canvas using the wizard you might want to rename it.

Step 6: Create a new window

Create a new window manually with only the basic details
Window properties

Step 7: Attach the window to the canvas

Now check the properties of the canvas created
The value of property Window is set to APPCORE_PROPERTIES by default as we had used the wizard to create the canvas.
We shall set it to the new window named, NEW_WINDOW.

Step 8: Add the window in the package, APP_CUSTOM

Go to Program Units within the form.
Double click on APP_CUSTOM package body. Locate the following section within the package,
1
2
3
4
5
6
7
8
9
10
11
if (wnd = '') then
  app_window.close_first_window;
elsif (wnd = '') then
  --defer relations
  --close related windows
  null;
elsif (wnd = '') then
  --defer relations
  --close related windows
  null;
end if;
Add the name of the window you have created now to this section. It will look like the following,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
IF (wnd = 'NEW_WINDOW')
THEN
   app_window.close_first_window;
ELSIF (wnd = '')
THEN
   --defer relations
   --close related windows
   NULL;
ELSIF (wnd = '')
THEN
   --defer relations
   --close related windows
   NULL;
END IF;

Step 9: Change First Navigation Block Name

We shall change the First Navigation Block name for the form so that the first block it picks up will be the data block we have created
Click on Form name
View the properties
As you can see the First Navigation Data Block is set to BLOCKNAME by default. Change this to the data block we have created, i.e. XX_SUPPLIER_BLACKLIST.

Step 10: Set the correct subclass information

Set the subclass information for all the form objects, like data block, canvas, window, items, etc. It will be set like the following,
We shall set the subclass for the data block we have created,
Open the properties of the block
Click on Subclass and the subclass popup window will open. Set the correct class name to it.
Click on OK.
The subclass will be set. Close the properties window.
Now notice the arrow on the block. It means that the subclass is set.

Step 11: Save and transfer the file to the server

Now you can save the file and transfer it in binary mode to the server. The fmb file should reside in $AU_TOP/forms/US directory.

Step 12: Compile the form

Connect to the server and execute the following command to compile the form.
In Oracle 11i the command will be,
1
2
f60gen userid=apps/ module_type=form module=$AU_TOP/forms/US/</pre>
<form name="">.fmb output_file=/</form><form name="">.fmx compile_all=special
In Oracle r12 the command will be,
1
2
frmcmp_batch userid=apps/ module=<$AU_TOP/forms/US/</pre>
<form name="">.fmb output_file=/</form><form name="">.fmx compile_all=special
Now the form is ready to be used.
Appendix:
To display debug messages in forms
Use the API, FND_MESSAGE.DEBUG. In the following example we have used this API in a PRE-UPDATE trigger.
When we update the data in the form we get a popup message like the following

No comments:

Post a Comment