|Receive Email for New Articles|
|CUSTOM.pll||| Print ||
|Written by Anil Passi|
|Sunday, 01 April 2007|
CUSTOM.pll is used to add extensions to Oracle's form Functionality. Some of the common scenario where CUSTOM.pll can be used are:-
1. Enabling/Disabling the fields
2. Changing the List of Values in a LOV field at runtime.
3. Defaulting values
4. Additional record level validations
5. Navigation to other screens.
6. Enabling Special Menu
Primarily there are two methods of extending Oracle Forms, and these are
In this article we will cover the basics of using CUSTOM.pll for extending Oracle Forms
How and why does CUSTOM.pll work?
Every form in Oracle Apps is created using something called as TEMPLATE.fmb. But some of the modules like HRMS have their own HR Specific Templates[HRTEMPLT.fmb]. These template files have form level triggers that make call to CUSTOM.pll. The triggers that can be trapped using CUSTOM.pll in HRMS screen can be different than those which can be trapped for other modules.
Commonly used events that are trapped using CUSTOM.pll are:-
However, for example in HRMS, you can also write code in CUSTOM.pll to trap below listed events :-
PRE-DELETE and POST-DELETE
PRE-UPDATE and POST-UPDATE
PRE-INSERT and POST-INSERT
How to identify which trigger is most suitable for writing your business logic?
You can either open the FMB itself, and see the triggers which are calling CUSTOM.pll.
However, there is a easier way to work out the most suitable triggers. You can navigate to Help/Diagnostics/Custom Code/Show Custom Events
Once that radio button has been set, you will see the list of Events Displayed on the screen.
In some cases, the desired WHEN-NEW-BLOCK-INSTANCE or WHEN-NEW-ITEM-INSTANCE are not being fired. What can I do?
It should always be possible to trap these events in CUSTOM.pll . But in some cases, the form might have these triggers at block/field level, with the trigger property being OVERRIDE. Due to this, the corresponding form level triggers[ to invoke CUSTOM.pll] do not fire. In this case you must raise a bug with Oracle on Metalink.
Structure code code in CUSTOM.pll
IF event_name = 'WHEN-NEW-FORM-INSTANCE'
IF form_name = 'ARXTWMAI' AND block_name = 'INVOICE_HEADER'
ELSIF form_name = 'ARXTWMAI' AND block_name = 'INVOICE_HEADER'
ELSIF event_name = 'WHEN-NEW-BLOCK-INSTANCE'
END IF ;
Lets take some scenario's where CUSTOM.pll can be used
1. Change the label of a field
app_item_property2.set_property ('BLOCK.FIELD',label,'New Label');
2. Default a value
copy (TO_CHAR (n_person_id),'PERSON_BLOCK.PERSON_ID' );
3. Alter the SQL for LOV Query
PROCEDURE filter_customers_in_lov IS
v_customer_group_id := create_group_from_query('XX_CUSTOMER_GROUP'
,'select ... from hz_cust_accounts where ..your custom criteria here..');
n_temp_id := populate_group(v_customer_group_id);
v_customer_lov := find_lov('EXISTING_LOV_NAME_HERE');
IF get_lov_property(v_customer_lov,group_name) = 'EXISTING_GROUP_NAME_HERE'
4. Make a field mandatory
Similarly you can enable or disable the fields too.
5. You can display messages, for example
fnd_message.set_name('APPL_SHORT_NAME_HERE', 'MSG_NAME_HERE'); or fnd_message.set_string('message text');
fnd_message.warn or fnd_message.error or fnd_message.
6. Enable or Disable Special Menu
PROCEDURE manage_special_menu IS
mi_id := find_menu_item('SPECIAL.SPECIAL15');
IF name_in('system.cursor_block') = 'INVOICE_HEADER' THEN
app_special2.instantiate('SPECIAL15', 'Print Invoice');
set_menu_item_property(mi_id, displayed, property_true);
set_menu_item_property(mi_id, enabled, property_true);
set_menu_item_property(mi_id, displayed, property_false);
7. Handle the click on Special Menu
IF event_name = 'SPECIAL15' THEN
IF form_name = 'INVOICE_FORM' THEN
IF form_name = 'SUPPLIER_FORM' THEN
8. Ask user a question, and take appropriate action
n_button_selection := fnd_message.question('Email Invoice', 'Fax Invoice', '', 1, 2, 'question');
IF n_button_selection = 1 THEN
9. Call Another form function
function_name => 'XX_FORM_FUNCTION_NAME_HERE'
,open_flag => 'Y'
,session_flag => 'SESSION'
,other_params => 'P_INVOICE_ID = "' || n_invoice_header_id || '"'
,activate_flag => 'Y');
10. Make some segments of a KeyFlexfield Display-Only depending upon some condition
For example to make 1st segment of a KFF display-only, we can use
IF v_check_result='xyz' THEN
BLOCK => 'BLOCKNAMEHERE'
,FIELD => 'FLEXFIELDNAME'
,ENABLED => 'Y'
,DISPLAYABLE => 1);
END IF ;
As you may have gathered by now, almost any form related task can be done using CUSTOM.pll
For additional reading on CUSTOM.pll, please visit
Best Practices for Development on CUSTOM.pll
Playing with CUSTOM.pll
written by balkrishna , April 02, 2007
written by Anil Passi , April 02, 2007
written by kumar , April 05, 2007
written by Viral , April 15, 2007
written by Pawan , April 19, 2007
written by Anil Passi , April 20, 2007
written by Datta , April 24, 2007
written by Anil Passi , April 25, 2007
written by srinivasarao , April 29, 2007
written by sandeep.yaparla , July 06, 2007
written by sandeep.yaparla , July 09, 2007
written by sandeep.yaparla , July 10, 2007
written by k.subbu , July 10, 2007
written by APassi , July 10, 2007
written by Ferry , July 13, 2007
written by kishan , August 16, 2007
written by fnd_key_flex.update_definition , September 02, 2007
written by chris , October 12, 2007
Master org to blocked
written by srinidhi goud , October 30, 2007
written by SharmaManu , October 30, 2007
written by Nile MA , November 15, 2007
Firing Sequence of the Triggers in Forms 6i...
written by Mark Valentine , November 26, 2007
written by Sangram , January 03, 2008
Disable When-Validate-item trigger
written by Vivek Kumr , January 14, 2008
change record group for lov in PO approve forward_to item
written by Alexandar , January 17, 2008
How to find responsibility and applicaion_id for the current application in the custom.pll
written by R A M S , February 21, 2008
written by Naveen Sankuratri , March 14, 2008
written by Julius Gonsalves , March 19, 2008
written by Julius Gonsalves , March 20, 2008
written by Julius Gonsalves , March 21, 2008