-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
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 CUSTOM.pll FORMS Personalizations 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:- ZOOM WHEN-NEW-FORM-INSTANCE WHEN-NEW-BLOCK-INSTANCE WHEN-NEW-RECORD-INSTANCE WHEN-NEW-ITEM-INSTANCE WHEN-VALIDATE-RECORD 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 POST-FORMS-COMMIT WHEN-CREATE-RECORD KEY-DELREC 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' THEN IF form_name = 'ARXTWMAI' AND block_name = 'INVOICE_HEADER' THEN xx_arxtwmai.default_customer; ELSIF form_name = 'ARXTWMAI' AND block_name = 'INVOICE_HEADER' THEN ..... END IF; ELSIF event_name = 'WHEN-NEW-BLOCK-INSTANCE' THEN ..... 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 recordgroup; n_temp_id NUMBER; v_customer_lov lov; BEGIN 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' THEN set_lov_property(v_customer_lov,group_name,'XX_CUSTOMER_GROUP'); END IF; END filter_customers_in_lov; 4. Make a field mandatory app_item_property2.set_property ('XXBLOCK_NAME.XXFIELD_NAME',required,property_true); Similarly you can enable or disable the fields too. 5. You can display messages, for example FND_MESSAGE.CLEAR; 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 menuitem; BEGIN 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); ELSE set_menu_item_property(mi_id, displayed, property_false); END IF; END manage_special_menu; 7. Handle the click on Special Menu IF event_name = 'SPECIAL15' THEN IF form_name = 'INVOICE_FORM' THEN xx_invoice_form.process_printing; END IF; IF form_name = 'SUPPLIER_FORM' THEN xx_supplier_form.email_supplier; END IF; END IF; 8. Ask user a question, and take appropriate action v_token_value VARCHAR2(1000); n_button_selection INTEGER; BEGIN fnd_message.set_name('APPL', 'MESSAGE'); fnd_message.set_token('XXTOKEN1', v_token_value); n_button_selection := fnd_message.question('Email Invoice', 'Fax Invoice', '', 1, 2, 'question'); IF n_button_selection = 1 THEN xx_call_invoice_print; ELSE xx_fax_invoice; END IF; 9. Call Another form function fnd_function.EXECUTE( 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 FND_KEY_FLEX.UPDATE_DEFINITION( 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 Comments
(43)
![]() ![]() written by balkrishna , April 02, 2007 ![]() written by Anil Passi , April 02, 2007
Cheers Bala
![]() written by kumar , April 05, 2007
hi Anil
If you can organize this site ...that will be really great thanks ![]() written by Viral , April 15, 2007
Is it possible to write any other (apart of 6 triggers mentioned in custom.pll) trigger to write in custom.pll. Like PRE-INSERT or PRE-UPDATE. I need to insert data in a staging table when the data in the form is INSERTED/UPDATED. How can I achieve this?
![]() written by Pawan , April 19, 2007
about forms customization.
I have three or four button in forms, i want to disable one button for particular user,not for senior lable person(like manager) can u send me the steps for this) thanks in advance pawan ![]() written by Anil Passi , April 20, 2007
Hi there
You can use forms personalizatiton to achieve this. In the context field, enter the USERNAME for which button needs to be hidden. In case there are two many users, then my question would be if superuser and lower-level user have differing responsibilities. If so, your context could be responsibility. If for some reasons you can not use Forms Personalization, then in CUSTOM.pll, use fnd_global.user_id or fnd_global.employee_id to drive your logic. Thanks, Anil ![]() written by Datta , April 24, 2007
Hi Anil,
I want to convert forms from Forms 4.5 to Forms 10g, What is the procedure for it? Will have to convert forms4.5 to forms 6i & then forms 6i to forms 10g? or is there any tool to do it. Please guide? ![]() written by Anil Passi , April 25, 2007
Hi Datta
Yes, try 4.5-->6.0-->10g route If that does not work, then 4.5-->6.0-->9g-->10g will certainly work. Thanks, Anil Passi ![]() written by srinivasarao , April 29, 2007
hi,
excellent article
hi
The document what your given is very good Actually i have one problem i need to display lov values based on my record group For this i created one record group programmatically and i attached this group to lov and I attached this lov to my item when i run it ‘s showing the old values. Actually the lov what am chaining is key flex field item lov i want to aching how can i help me out
ya anil Thanks for your reply but i tried to override the kff lov with my lov for perticular item but its not showing its's displaying the old values.
would please give me an example because iam structed in middle i need to finish it asap please thanks regards sandeep.
Hi anil
thanks i got it. regards sandeep
Dear Anil,
The articles in your website is excellent.It gives an indepth knowledge to anyone.The presentation of the articles is also excellent. I am looking forward for some more articles like this. i want form fire trigger sequence in oracle forms please send ASAp. Thanks & Regards, subbu
Hi Subbu
You can put some messages in these form triggers and note down the sequence in which they fire. If I remember it correctly, the sequence is pre-form, when-new-form, pre-block,-when-new-block, pre-item, when-new-item. I tried this some 8yrs ago, by putting in messages into these triggers. Please correct this if your findings are any different. Thanks Anil Passi
Hi Anil,
first of all, thanks so much for this wonderful site, i learnt a lot. i m thinking to customize the LoV query in Expenditure Type column in AP Invoice Distribution. currently the Lov showing all the expenditure types, while in fact it should be restricted based on Resource Group defined in Project. can i do this thru custom.pll??? Thanks&Regards, Ferry
Hi,
Can we handle the clear tool from tool bar in custom.pll Regards B.kishan kumar
Hi Anil,
i need some help on the point 10 on this document. copied below: ,FIELD => 'FLEXFIELDNAME' what do we need to put here? for instance what could be FIELD when the flexfield is 'system items'? can we know this using the 'help->diagnostic->??' thanks, ahmed 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 FND_KEY_FLEX.UPDATE_DEFINITION( BLOCK => 'BLOCKNAMEHERE' ,FIELD => 'FLEXFIELDNAME' ,ENABLED => 'Y' ,DISPLAYABLE => 1); END IF ;
Hi,
Iam facing one situtation ,How to trap the clear record event in the custom.pll in PO screen. KEY-DELREC and KEY-CLRREC are captured only in HRMS module or it can also capture in PO(distribution) module Regards, B.kishan kumar
Hi,
Iam facing one situtation ,How to trap the clear record event in the custom.pll in PO screen. KEY-DELREC and KEY-CLRREC are captured only in HRMS module or it can also capture in PO(distribution) module Regards, B.kishan kumar
Hi anil,
I need to write two custom codes to custom.pll and add a DFF. Details are 1)the oracle user,contractor and preparer should all be employees. in requisition and receipt forms emp name is mandatory. the two validations needs to such that supp name associated with contractor should not be same as the suppname entered in requisition form and receipt form. If they are same then the validation should not allow to save transaction if a) ora user/preparer has entered supp to whom preparer/user belong to and b)if user has entered receipt against PO having supp same as user associated supp.The DFF will have Context value field for employee having LOV of ‘Employee’ and ‘Contractor’ ,if user selects the value as ‘Contractor’, then supplier field will be prompted ,which is mandatory . Thanks chris
Hi anil,
I have a requirement to block the master org in the change organization form. How can i do this using custom.pll. Thanks and regards, Srinidhi.
Hi Anil,
I found your site couple of weeks back and I found it very usefull, thanks for all your efforts. If possible please provide an insight. Question : Requirement is that If ITEM has 0(ZERO) UNIT_PRICE than user should not be able to select it in PO form (POXPOEPO). I dont want to customize form for this but enable to do it using Custom.pll, I'm able to pop-up message using Form Personalization but still Unit Price field is editable. Thanks
Hi,
I read your article on Making some segments of a KeyFlexfield Display-Only depending upon some condition. Similarly, is it possible to make some segments of a Descriptive Flexfield Disabled or ReadOnly. It will be helpful if you assist me. Thanks, Nile.
Hi to all...
Such a wonderful site... You have Anil Passi... I would like to have the firing sequence of the triggers in the forms 6i..... Regards, Mark V.
Is there any way of using set_menu_item_property in forms personalization?
Hi Anil, First i want to thank you for posting valuable technical/functional solutions.
I have one issue, that is a particular forms retrieves required record when the Help->diagnostics-Custom Code ->Off . But the same time Help->diagnostics-Custom Code ->Normal, when i move the block its not showing correct records. Question is Help->diagnostics-Custom Code ->Off in this case what are the code will be disabled.
Hi Anil, First i want to thank you for posting valuable technical/functional solutions.
I have one issue, that is a particular forms retrieves required record when the Help->diagnostics-Custom Code ->Off . But the same time Help->diagnostics-Custom Code ->Normal, when i move the block its not showing correct records. Question is Help->diagnostics-Custom Code ->Off in this case what are the code will be disabled. Is it personalization code or custom.pll code or even some customization code from form trigger
Hi
is there any way using form Personalization, I can disable the When-Validate-Item trigger.
Hi,
I discovered that bind variable :po_approve.approval_path_id can not be used in record group, how to overcome this limitation? Thanks. ![]() written by R A M S , February 21, 2008
Hi,
I have a requirement in Purchasing Order form by using Form personalization or Custom.pll, Requirement is as follows 1. Po Num(segment1 column) should be enabled (its done, no issue abt it) 2. Po number will be populated on our own sequences along with resp_name (first 3 letters) by concatanated with resp_name. Thanks in advance for your valuable suggestions, With Best, Ramprasad K M U M B A I.. For example BBC(where BBC is British Brod Corporation)
I need to do this:
I need to do a validation in a standart form (OEXOEORD.fmb from release 12), using custom.pll, when i press the commit button. Thanxs It's URGENT!!! sorry my english!!!!!!! thanxs again.
I need to do this:
I need to do a validation in a standart form (OEXOEORD.fmb from release 12), using custom.pll, when i press the commit button. Thanxs It's URGENT!!! sorry my english!!!!!!! thanxs again.
Hi Anil,
Its good to follow foot steps of Great people.Its not a bad thing to copy good ideas from people like you
Hi Anil,
All your examples are very useful. I need to open a Custom From by button press of an Oracle Form. At present this button press is opening an Oracle Form. What are the steps? Thanks, Julius
Hi Anil,
Can we write code in CUSTOM.pll for the event WHEN-BUTTON-PRESSED? At present 'Find' button of eBusiness Center Form (ASTRCALL) is calling Universal Search Form (ASTLSGEN). I created a Custom Form based on ASTLSGEN.fmb. Now I want 'Find' button of eBusiness Center Form (ASTRCALL) should call my form instead of Universal Search Form (ASTLSGEN). Can it be done by Form Personalization? How? If we need to use CUSTOM.pll for this, what are the steps? Thanks, Julius
Hi Anil,
Many thanks for your quick respond. That means FP or CUSTOM.pll will not work for WHEN-BUTTON-PRESSED event of an Apps form? Julius You must be logged in to a comment. Please register if you do not have an account yet.
|
i think u can elobrate this topic using some real time example
this will help in great
thnaks
balkrishna