CUSTOM Oracle ERP JAVA FORM DEVELOPMENT USING PLSQL
CUSTOM Oracle ERP JAVA FORM DEVELOPMENT USING PLSQL
Contents
Prerequisites.................................................................................................................................6
Base Directory..........................................................................................................................6
Environment Variable.............................................................................................................6
Creation of New Form................................................................................................................7
Standard Template..................................................................................................................7
Open Standard Template....................................................................................................7
Change Module Name........................................................................................................7
Remove standard Objects...................................................................................................8
Data Block.........................................................................................................................8
Canvas...............................................................................................................................8
Windows...........................................................................................................................8
Create or Change Objects........................................................................................................9
Create Window....................................................................................................................9
Create Canvas.....................................................................................................................10
Change Trigger...................................................................................................................11
Change Program Units......................................................................................................12
Create Data Block...............................................................................................................12
Master Detail Relationship...................................................................................................18
Create Master Data Block..................................................................................................18
Create Details Data Block.................................................................................................23
Other Objects..............................................................................................................................29
Working with List of Value (LOV)......................................................................................29
Apply Calendar LOV on Date type Text Field...............................................................29
Apply LOV on Text Item..................................................................................................30
Create Record Group.....................................................................................................30
Create LOV.....................................................................................................................32
Working with Text Item........................................................................................................34
Making Text Item Mandatory..........................................................................................35
Working with Display Item..................................................................................................35
REQUIRED:................................................................................................................................58
Prerequisites
Base Directory
Create folder as given below
D:\AU
12.0.0
D:\AU\12.0.0\forms
D:\AU\12.0.0\resources
D:\AU\12.0.0\plsql
Environment Variable
Set environment variable FORMS_PATH as given below
D:\AU\forms\template.fmp
Data Block
Canvas
Windows
Data Block
Remove Following two Data Blocks
BLOCKNAME
DETAILBLOCK
Canvas
Delete following Canvas
BLOCKNAME
Windows
Delete following Window
BLOCKNAME
Windows
Canvas
Change Trigger
Change Program Units
Data Blocks
Create Window
Click Window
Press (create button) from left side Button Pallette
Name: PAYMENT_WIN
Subclass Information: WINDOW
Title: Payment Form
Maximize Allowed: No
Minimize Allowed: No
Create Canvas
Click Canvases
Press (create button) from left side Button Pallette
Change Trigger
Change following form level trigger
PRE-FORM
Master
Details
Note: user can change the names of data blocks as per development requirements
Other Objects
Working with List of Value (LOV)
LOVs are used when the user must select from a list of valid values in a text field.
After pressing OK button, new window will appear to enter your trigger
command/query. Type following command, compile your trigger, save it and
then exit, as given in screenshot.
calendar.show;
During data entry when you click “LOAN DATE” calendar will appear, as
shown below:
By doing so, Record Group (RG) will be created with default name.
Click on newely created RG and press F4 to get its properties, as
shown in the following screenshot.
Important:
o You can change the record group query after creating RG by clicking
“Record Qroup Query” property from RG properties window, as
mentioned in above screenshot.
Create LOV
Perform the folloing steps:
LOV >
After pressing button, window will appear, select option “Build a new
LOV manually” and then press OK button, as mentioned in the following
screenshot.
After completion of step-1 above, you can see new LOV object in LOV
list, as given in following screenshot.
Double click this new created LOV to open its properies window
Name: FACILITY_LOV
Subcalss Information: LOV
List Type: Record Group
Record Group: FACILITY_RG
Width: 2
Height: 5
Important:
Each column name listed under “Column Names” in “LOV Column
Mapping” window must match with columns in the record group
query.
In step 8 we provide “Return Item”, which is the actual Text Item Field
available in our “MASTER” block. After maping “Return Item”, data will
be populated in the Return Item Field (i.e “MASTER.FACILITY” in our
case) when you select data from LOV at runtime.
Step 9 shows “Column Title” along with “Display Width” (2 in our case).
Simillarly, step 5 shows the LOV window “Width” and “Height”, as
mentioned in following screenshot.
Note:
Property “Validate from List” allows a user to type a partial value into the
field, and it will auto-reduce against the list of valid values.
Now, this text item will be editable and required with yellow background, which
can be observed during data entry.
Now, this field will not be editable with Grey background, which can be
observed during data entry.
Buttons
Used to initiate an action, such as a product-specific function, or block-to-block navigation.
Create Button
To create button perform the following steps, as mentioned in the screenshot.
Click on newly created text item and press F4 or double click it to get its properties
Name: OK_PB
Item Type: Push Button
Subclass Information: BUTTON
Label: OK
Access Key: O
Canvas: <canvas name>
Triggers
Form level
WHEN-NEW-FORM-INSTANCE
WHEN-WINDOW-CLOSED
PRE-FORM
WHEN-TAB-PAGE-CHANGED
KEY-COMMIT
Block Level
WHEN-NEW-BLOCK-INSTANCE
WHEN-NEW-RECORD-INSTANCE
WHEN-VALIDATE-RECORD
WHEN-VALIDATE-BLOCK
WHEN-BUTTON-PRESS
WHEN-CHECKBOX-CHANGED
KEY-COMMIT
PRE-INSERT
PRE-UPDATE
QUERY-FIND
PRE-QUERY
Item Level
WHEN-VALIDATE-ITEM
WHEN-NEW-ITEM-INSTANCE
KEY-NEXT-ITEM
WHEN-BUTTON-PRESSED
Program Units
The New Program Unit dialog allows you to specify a name and type of program unit to create.
The following Types are Exist.
Function
Procedure
Package Body
Package Specification
Control Objects
Control Block
A control block is not associated with the database, and the items in a control block do not relate
to table columns within a database.
Control Items
Items that does not have a relationship to a database table or items that do not correspond to
columns in a database table. Examples of control items are buttons, text items, check boxes, etc.
Database Item: No
Column Name: Null
5. Once field is created in table, add field in form as given in the following
screenshot.
6. Click on newly created text item and press F4 or double click it to get its
properties
Name: DESCRIPTION
Subclass Information: TEXT_ITEM
Data Type: Char
Maximum Length: 150
Database Item: Yes
Column Name: DESCRIPTION
Canvas: LOAN_CAN
Width: 1.5
Height: 0.25
Prompt: Description
Prompt Justification: Start
Prompt Attachment Edge: Star
Prompt Allignment: Start
Note: when you add field in multiline datablock, prompt allignment properties
should be as follows
Prompt: Description
Prompt Justification: Center
Prompt Attachment Edge: Top
Prompt Allignment: Center
8. Close properties window, press F2 to get your required canvas. In canvas view,
you will find newly created field (i.e. DESCRIPTION) at the top left corner of
view window.
9. Click and drag this field on appropriate location, as given in the screenshot.
Database Item: No
Column Name: Null
Canvas: Null
Required: No
TO_NUMBER (FND_
Keeps track of which user created
CREATED_BY Number Not Null PROFILE. VALUE
each row
('USER_ID'))
Stores the date on which each row
CREATION_ DATE Date Not Null SYSDATE
was created
TO_NUMBER (FND_
Keeps track of who last updated
LAST_ UPDATED_BY Number Not Null PROFILE. VALUE
each row
('USER_ID'))
Stores the date on which each row
LAST_UPDATE_ DATE Date Not Null SYSDATE
was last updated
Provides access to information
TO_NUMBER (FND_
about the operating system login
LAST_UPDATE_ LOGIN Number PROFILE. VALUE
of the user who last updated each
('LOGIN_ ID'))
row
Any table that may be updated by a concurrent program also needs additional columns
FND_STANDARD.SET_WHO
Drag QUERY_FIND Object Group from APPSTAND.fmb form to your Custom Form’s
Object Group. After doing so, we automatically get Window, Canvas, Data Block objects
with the name QUERY_FIND.
Once you drag and drop the QUERY_FIND Object, it will ask for Copy or Sub-Class.
Select Copy option.
Apply subclass information to Window, Canvas as well as Block. And drag these to first
position as shown in below.
Give target Block name (the header block which you want to find) in WHEN-BUTTON-
PRESSED trigger of New and Find Button. Compile and close.
Drag the QUERY_FIND trigger from standard form (APPSTAND.fmb) and place it in
block level trigger of your target header block (i.e. DEPT).
Syntax:
Example:
APP_FIND.QUERY_FIND(‘DEPT_WINDOW’, ‘QUERY_FIND’,’QUERY_FIND’);
Next Create PRE-QUERY trigger in the block level (i.e. DEPT block)
Syntax:
:parameter.G_query_find := FALSE;
END IF;
Example:
COPY(:QUERY_FIND.DEPTNO, ‘DEPT.DEPTNO’);
:parameter.G_query_find := ‘FALSE';
END IF;
Form Level
In the form module (i.e. XXMZ_Query_Find form) give the first navigation block as
QUERY_FIND.
Block Level
In the QUERY_FIND Data Block give next navigation block as your target block (i.e.
DEPT block).
RET_BOOLEAN := FND_REQUEST.ADD_LAYOUT
(
TEMPLATE_APPL_NAME => <APPLICATION_SHORT_NAME>, -- AR,ONT
TEMPLATE_CODE => '<TEMPLATE-CODE>',
TEMPLATE_LANGUAGE => 'EN',
TEMPLATE_TERRITORY => 'US',
OUTPUT_FORMAT => 'PDF'
);
RET_BOOLEAN := FND_REQUEST.SUBMIT_REQUEST
(
APPLICATION => 'APPLICATION-SHORT-NAME',
PROGRAM => 'PROGRAM-SHORT-NAME',
DESCRIPTION => 'PROGRAM-DESCRIPTION',
START_TIME => SYSDATE,
SUB_REQUEST => FALSE,
ARGUMENT1 => <PARAMETER1>,
ARGUMENT2 => <PARAMETER2>,
ARGUMENT3 => <PARAMETER3>,
ARGUMENT99 => <PARAMETER99>,
CHR(0)
);
RET_BOOLEAN := FND_DELIVERY.ADD_FTP
(
SERVER => <TARGET-SERVER-IP> -- DB NODE IP
USERNAME => 'ORACLE',
PASSWORD => '<PASSWD>',
REMOTE_DIR => '<PATH>' --/ORADB01/ATTACHMENTS_APPS1',
PORT => NULL,
SECURE => TRUE,
LANG => NULL
);
If a customized form has been developed using oracle form builder then the form can be
integrated with oracle applications. Oracle strongly recommends that pick a template
of .fmb file from AU_TOP.
Example:
“/d01/oracle/apps/apps_st/appl/au/12.0.0/forms/US/TEMPLATE.fmb”, copy this
TEMPLATE.fmb to your personal folder start development on it.
The following steps highlight how to integrate a form with oracle applications:
Example: /d01/oracle/apps/apps_st/appl/au/12.0.0/forms/US
Form Compilation
1. Source the Application Environment:
. /d01/oracle/apps/apps_st/appl/APPSTEST_testapps.env
2. Compile the Form:
Execute the following command, replacing with your form name instead of the example
given below:
Create Form
Login to Oracle Applications with the “Application Developer” responsibility.
Form : In the form select “User Form Name” from List of values which you have
defined in point # 5.
Note: The rest of the fields are default populated. All other information is entered by
default. Save your work. Once this is saved, the form is fully registered with oracle
applications. It can be assigned to any menu as a function.
Find responsibility where you want to configure your customized form and just copy
the Menu and close this window.
Find out menu which you have copied from the prior screen i.e.: AP_NAVIGATE_GUI2
ENTERABLE
APP_ITEM_PROPERTY.SET_PROPERTY(ITEMID, ENTERABLE,PROPERTY_ON);
Equivalent To:
SET_ITEM_INSTANCE_PROPERTY(ITEMID, CURRENT_RECORD,INSERT_ALLOWED,
PROPERTY_ON);
SET_ITEM_INSTANCE_PROPERTY(ITEMID, CURRENT_RECORD,UPDATEABLE, PROPERTY_ON);
SET_ITEM_INSTANCE_PROPERTY(ITEMID, CURRENT_RECORD,NAVIGABLE, PROPERTY_ON);
Also Equivalent To
SET_ITEM_PROPERTY(ITEMID, INSERT_ALLOWED, PROPERTY_ON);
SET_ITEM_PROPERTY(ITEMID, UPDATEABLE, PROPERTY_ON);
SET_ITEM_PROPERTY(ITEMID, NAVIGABLE, PROPERTY_ON);
DISPLAYED:
APP_ITEM_PROPERTY.SET_PROPERTY(ITEMID, DISPLAYED,PROPERTY_ON);
Equivalent To:
SET_ITEM_PROPERTY(ITEMID, DISPLAYED, PROPERTY_ON);
ENABLED:
APP_ITEM_PROPERTY.SET_PROPERTY(ITEMID, ENABLED,PROPERTY_ON);
REQUIRED:
APP_ITEM_PROPERTY.SET_PROPERTY(ITEMID, REQUIRED,PROPERTY_ON);
Is Equivalent To:
SET_ITEM_PROPERTY(ITEMID, REQUIRED, PROPERTY_ON);