Tuesday, November 3, 2009

20 essential steps to Form development in Oracle Apps

Mandatory Form and Libraries
============================

1. Download these forms in bin mode from $AU_TOP/forms/US

TEMPLATE.fmb
APPSTAND.fmb

2. get all PLLs in bin mode from $AU_TOP/resource

Setting up Forms60_Path in Registry
===================================

3. Copy all these PL/SQL libraries and the Template form in one folder.

4. Set the form60 path in the registry.

Go to Start -> Run -> Regedit -> HKEY_LOCAL_MACHINE -> Software -> Oracle
Here we can find the oracle homes.
In these homes check for FORMS60_PATH.
Append the path of your folder where all the libraries and the form is present, prefixed with a semicolon(;).

E.g.: Before Appending “C:\forms\TOOLS\OPEN60\PLSQLLIB”
After Appending “C:\forms\TOOLS\OPEN60\PLSQLLIB;c:\forms\libraries”


Develop the form using Form Builder Tool
========================================

5. Open the Forms Builder tool and click on the “Build a form based on a template” radio button
Choose the TEMPLATE.fmb form from your local working directory.
SAVE your new FORM as with a different filename.
Also rename the module with the same name as the filename.

6. Delete BLOCKNAME & DETAIL BLOCK FROM DATABLOCK,

7. DELETE BLOCKNAME FROM CANVAS AND WINDOW

8. Create a window NEW_WIN, canvas NEW_CAN
Create a new block based on the table you created in your custom schema


Changes to be made in the Triggers and Program Units
====================================================
9. Modify specific trigger properties and program units to ensure the form will appear properly in Oracle Apps.


10. In the Property Palette of your module modify the ‘First Navigation Data Block’ property to the name of your first data block.

11. In the APP_CUSTOM.CLOSE_WINDOW program unit modify the following line:

if (wnd = '') then app_window.close_first_window;

by changing to the name of your first window

Note: Also make sure the ‘Window’ property for your canvases are set to the proper window

12. In PRE-FORM trigger -

app_window.set_window_position('', 'FIRST_WINDOW');

app_window.set_window_position('XXEDP_QA_WIN_INITIAL_INFO', 'FIRST_WINDOW');

13. In WHEN-NEW-FORM-INSTANCE -

FDRCSID('$Header: TEMPLATE.fmb 115.12 2003/12/19 11:02 mzasowsk ship $');


cHANGE IT TO

FDRCSID('$Header: XXEDPQA_READ_CODES 115.12 2009/01/28 mzasowsk ship $');


Form objects
=============

14. Create your blocks, items, triggers and relationships as per requirement.
Save your FORM frequently.

15. Apply property classes to each item to ensure the same look and feel as the rest of Oracle Apps forms.

For each Module, Canvas, Window etc., apply the Property Classes that is most appropriate.

Item Type Property Class
--------- --------------
Module MODULE
Canvas CANVAS
Window WINDOW
Data Block BLOCK
Row ID ROW_ID
Text Item TEXT_ITEM
Display Item DISPLAY_ITEM or EXT_ITEM_DISPLAY_ONLY
Creation Date CREATION_OR_LAST_UPDATE_DATE
Last Update Date CREATION_OR_LAST_UPDATE_DATE
Date fields TEXT_ITEM_DATE

To apply the property class, click on the small button (on the right) on the “Subclass information” property of the property sheet of each item.
In the “Subclass Information” Window choose the property class radio button. Then choose the correct property class for the current item.

Note: You cannot apply property classes to multiple items at once.

Attaching a Calendar to Date field
==================================
Date Item Properties
Subclass information TEXT_ITEM_DATE
List of Values ENABLE_LIST_LAMP
Validate from List No

Add an Item Level Trigger
Trigger KEY-LISTVAL
Code Calendar.Show;


Setting Who Columns
===================

Make sure you have following columns named exactly same in table and text items named exactly same as follows

CREATION_DATE DATE NOT NULL,
CREATED_BY NUMBER NOT NULL,
LAST_UPDATE_DATE DATE NOT NULL,
LAST_UPDATED_BY NUMBER NOT NULL,
LAST_UPDATE_LOGIN NUMBER NOT NULL

Write fnd_standard.set_who; in Pre-Update and Pre-Insert triggers at block level


Transferring the “.fmb” file from local system to Apps Instance
=================================================================
16. Make sure you transfer the form in "Binary" (bin) mode

Generating the “.fmx” file on the Vision Instance
==================================================
17. Compile command will be something like :

f60gen .fmb userid=apps/@


change mode of file:

chmod 755 .fmx



Register Form, define function, attach to menu
==============================================
18. Register Form

Go to Application Developer Responsibility

Application -> Form


Form:
Application:
User Form Name:
Description:

19. Define Function for the form

Go to From Application Developer Responsibility

Application -> Function

Description tab -
Function:
User Function NAme:
Description:

Type: Form

Form:

20. Assign the menu for the form

Application -> Menu

Here we have to decide, in which responsibility we have to put this form.
Choose menu based on responsibility. Decide under which submenu the form should be kept.

Responsibility-
Menu-
Application-

Encyption and Decryption in Oracle

Oracle provides standard Encyption and Decryption with it's dbms_obfuscation_toolkit package.
Here is a sample code which shows how to use it.

DECLARE
input_string VARCHAR2(32) := 'this1234password';
raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(input_string);

key_string VARCHAR2(8) := 'vinayjos';
raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(key_string);

encrypted_raw RAW(2048);
encrypted_string VARCHAR2(2048);

decrypted_raw RAW(2048);
decrypted_string VARCHAR2(2048);

error_in_input_buffer_length EXCEPTION;
PRAGMA EXCEPTION_INIT(error_in_input_buffer_length, -28232);
INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2(100) :=
'*** DES INPUT BUFFER NOT A MULTIPLE OF 8 BYTES - IGNORING EXCEPTION ***';

BEGIN
dbms_output.put_line('> ========= BEGIN TEST RAW DATA =========');
dbms_output.put_line('> Raw input : ' ||
UTL_RAW.CAST_TO_VARCHAR2(raw_input));
BEGIN
dbms_obfuscation_toolkit.DESEncrypt(input => raw_input,
key => raw_key, encrypted_data => encrypted_raw );

dbms_output.put_line('> encrypted hex value : ' ||
rawtohex(encrypted_raw));

dbms_obfuscation_toolkit.DESDecrypt(input => encrypted_raw,
key => raw_key, decrypted_data => decrypted_raw);

dbms_output.put_line('> Decrypted raw output : ' ||
UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw));

dbms_output.put_line('> ');

if UTL_RAW.CAST_TO_VARCHAR2(raw_input) =
UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw) THEN
dbms_output.put_line('> Raw DES Encyption and Decryption successful');
END if;

EXCEPTION
WHEN error_in_input_buffer_length THEN
dbms_output.put_line('> ' || INPUT_BUFFER_LENGTH_ERR_MSG);
END;
dbms_output.put_line('> ');
END;
/

Wednesday, April 22, 2009

Retrieving client machine information in Oracle Applications Form

Overview

This document provides step by step approach of using a Javabean component to retrieve client machine information in Oracle Applications Form.

Oracle has provided an approach for Forms 6i (check reference below) but for implementating similar javabean in Oracle Applications, a different setup/configuration is required.

The reason is when the Form is registered in Oracle Applications and run from there, the configuration file that is read is not formsweb.cfg. Instead, a appsweb.cfg(or a custom .cfg file) is read.

This configuration file is set as $FORMS60_WEB_CONFIG_FILE and can be found at $COMMON_TOP/html/bin.

Forms configuration

Configuration for GetClientInfo on Application Server

· Connect to Application Server

· FTP the attached "GetClientInfo.jar.sig" file in BINARY mode to the "$OA_JAVA/oracle/apps/fnd/jar" directory on Application Server

Note: This file can be downloaded fron Oracle Technology Network (check reference below)

· Make sure the file size is 6324 bytes. If the file size is not 6324, that means it was not transferred in BINARY mode.

· Modify $FORMS60_WEB_CONFIG_FILE ($COMMON_TOP/html/bin) on Application Server as follows:

Find out archive tag and add " GetClientInfo.jar.sig " file at the end
Example: (archive=/OA_JAVA/oracle/apps/fnd/jar/fndforms.jar,....., OA_JAVA/oracle/apps/fnd/jar/GetClientInfo.jar.sig)

How to implement this bean in your own form

The fully qualified name for this JavaBean is oracle.forms.demos.GetClientInfo (note that Java is case sensitive).

This JavaBean must be added to a Form application using the BeanArea item. Place the BeanArea item on a canvas and then set the implementation class property to be the fully qualified name for the GetClientInfo JavaBean. You do not need to add the .class suffix.

The JavaBean must be set to visible in your application otherwise it will not be initialized and therefore will not work. You can hide the JavaBean by making it 1x1 in size and setting the background property to the same color as the canvas on which it is placed.





This JavaBean supports the following properties which can be programatically manipulated to modify the behavior of the Rollover Button.

With Oracle Forms Server 6i, the JavaBean can be directly queried and return data directly to the Form through the use of the GET_CUSTOM_PROPERTY builtin. This builtin will send a predefined property to the JavaBean for which it wishes to know the value. The JavaBean returns the data value directly as the return value of the builtin. There is no need to create and dispatch a CustomEvent to return the data. This is a far simpler approach and will make the use of JavaBeans far easier and more flexible.


USERNAME
This property is used to indicate to the JavaBean that it should return the value of the USERNAME property to the running Form application.



Forms Usage

username := GET_CUSTOM_PROPERTY(hBean,1,'USERNAME');


HOSTNAME
This property is used to indicate to the JavaBean that it should return the value of the HOSTNAME property to the running Form application.


Forms Usage

hostname := GET_CUSTOM_PROPERTY(hBean,1,'HOSTNAME');

IPADDRESS
This property is used to indicate to the JavaBean that it should return the value of the IPADDRESS property to the running Form application.


Forms Usage

username := GET_CUSTOM_PROPERTY(hBean,1,'IPADDRESS');



Verify that your bean is working correctly
Verify that the customization has been properly installed by following steps:
· Login to oracle apps application with appropriate username and password..
· Go the responsibility and open the form
(Note: If a java permission screen appears, choose “Grant Always”)
· Click Java Consol (coffee mug icon) in tool barJava Consol window will open.

· Make sure ‘GetClientInfo.jar.sig’ is loaded



Troubleshooting

1) Remember to use signed copy of the class file.

2) Remember to put file in correct directory in "binary" mode.

3) Verify that the file is listed in correct .cfg file.

4) Problems with Java Plug-in

It has been observed that the javabean may not work properly if you are using Java Plug-in instead of Jinitiator.

In that case, get a patch from Oracle.

They have a patch# 8402746 if you are using Forms 6.0.8.28.0 and Java Plug-in 1.6.0_12 (JRE version 1.6.0_12 Java HotSpot(TM) Client VM).



Reference
http://www.oracle.com/technology/sample_code/products/forms/extracted/getclientinfo/readme.html

Let's try

It is a good idea to spend available time to write your ideas in your own blog. There is nothing like sharing information in the world of IT.
My blog will mostly have technical information on Oracle databases and applications.
Sometimes I may even wander in subjects of common sense :)