How to compile Custom.pll in R12.1.3


How to compile Custom.pll in R12.1.3


Custom Library (custom.pll) allows to extend/customize Oracle Applications form(Oracle Form) without changing or modifying Oracle Applications code. Examples may include enforcing a new business rule, opening a form using zoom etc. Most of the things that we can do using custom.pll, we can achieve that using Forms Personalization. Since Custom.pll takes the full advantage of PL/SQL so it is having an edge over Forms Personalization for complex customizations.
CUSTOM.pll is used to add extensions to Oracle’s form Functionality.

Some of the common scenarios where CUSTOM.pll can be used are:-
1. Enabling/Disabling the fields
2. Changing the List of Values in a LOV field at runtime,but we cannot add  the new column in standard LOV
3. Defaulting values
4. Enabling Special Menu


Where is this located?
Custom.pll is located in $AU_TOP/resource Directory.

How to add code to this?
Open this pll using the Form builder and make changes to the program units.

How to compile this PLL?
Once you make changes you need to compile the pll. Use the F60gen to compile it at 11i version
f60gen module=custom.pll userid=APPS/ output_file=$AU_TOP/resource/custom.plx module_type=library batch=no compile_all=special

How to make the changes get affected?
Once you make all the necessary changes, compile the pll and generate the PLX file. Since the CUSTOM library is loaded once for a given session, a user must log out of the application and sign-on again before any changes will become apparent.

Forms Personalization: an alternative of custom.pll
In older versions, prior to 11i, Custom.PLL was most prominently used for adding additional features in the seeded form but the latest version of Oracle EBS comes with the feature called as Forms Personalization which allows even an end user to alter the seeded forms functionality using an user interface called the Personalization form.

Advantages of Forms Personalization over Custom.PLL:
  • Forms personalization can be used by an user with limited PL/SQL knowledge. 
  • Changes take place immediately on reopening the form.
  • Anything which can be done using Custom.PLL can be done using Forms Personalization also.
  • Personalizations are stored in base tables related to Form Personalization.
  • CUSTOM.pll is a single file/entity, hence only one developer can make changes to CUSTOM.pll at any given point in time. This is not a restriction in Forms personalization.
  • Easy to disable/enable with click of a button.
  • Can be moved easily through FNDLOAD from one instance to other.
  • Can be restricted at site/responsibility/user level.
  • Personalization stores who columns with which we have the ability to track who created/modified it where as in CUSTOM.PLL we don’t have that ability.

R12 the compilation command is given below


frmcmp_batch module=CUSTOM.pll userid=apps/apps output_file=CUSTOM.plx module_type=LIBRARY batch=yes compile_all=special



frmcmp_batch module=$AU_TOP/forms/US/XX_DRI_INC.fmb userid=apps/devapps output_file=$XXJERI_TOP/forms/US/XX_DRI_INC.fmx compile_all=special batch=yes

How to change the title of  standard LOV in Form.

Generally In forms, LOV is using for displaying the values, so that it is easily for user to choice and select the value.

rg_id RECORDGROUP;
 rg_name VARCHAR2(100) := 'XXRO_SERIAL_NUM';
 v_sql_string VARCHAR2(32000);
 errcode NUMBER;
 l_error_message VARCHAR2(200);
 the_rowcount NUMBER;
 v_lov      lov;
 v_rec_pos number;
 form_name  varchar2(30) := name_in('system.current_form');
 item_name  varchar2(30) := name_in('system.current_item');
 block_name varchar2(30) := name_in('system.current_block');

IF (event_name = 'WHEN-NEW-ITEM-INSTANCE') THEN
   v_rec_pos := 2;
    IF (form_name    = 'XXCUSTOM') THEN
    v_rec_pos := 3;
    IF (block_name = 'FIND_BASIC')THEN      
 BEGIN
  rg_id := Find_Group( rg_name);
 IF Id_Null(rg_id) THEN
                 rg_id := Create_Group_From_Query
                 (rg_name,
                 'select serial_number,inventory_item_id ,item,"description" '
                  ||' from (select distinct decode(a.customer_product_id,'||''' '''||',a.serial_number,'
    ||' cp.serial_number) serial_number, a.inventory_item_id, '
    ||' b.concatenated_segments item, cp.external_reference "description" '
    ||' from csd_repairs a, mtl_system_items_kfv b,csi_item_instances cp '
    ||' where a.inventory_item_id = b.inventory_item_id '
    ||' and b.organization_id = cs_std.get_item_valdn_orgzn_id '
    ||' and a.CUSTOMER_PRODUCT_ID = cp.INSTANCE_ID(+))'
    ||' where serial_number is not null '
    ||' order by 1');
             
   END IF;

errcode := Populate_Group(rg_id);

v_lov    := find_lov('RO_SERIAL_NUM');

 

  set_lov_column_property(v_lov, 4, TITLE, 'Chassis Number');  

IF get_lov_property(v_lov,group_name) = 'RO_SERIAL_NUM' THEN

     set_lov_property(v_lov,group_name,rg_name);

 END IF;

 END IF;

 END IF;

 END IF;

END;

How To Customize Standard Oracle Application Using Custom Library – custom.pll
There are numerous scenarios for each customer to customize the standard Application. The following sample code demonstrate how to pop up an error message when customer business validation fails.
This note provides a detail steps for customizing the standard application using custom library.
The code attached here will validate number of digits entered in Customer PO Number field from the sales order form. If the number of digits exceeds 3 digits an error message needs to be populated.
  1. Take a back up of custom.pll and custom.plx from $AU_TOP/resource
  2. Have custom.pll, appcore.pll and appcore2.pll copied over to your local folder. The best method is to just copy the entire contents of $AU_TOP/resource
  3. Open CUSTOM.pll in Oracle Forms Developer
  4. Attach appcore2.pll to the custom library
  5. Modify the text of the CUSTOM package body in the appropriate section as below
  6. Save your changes and use the Oracle Forms Compiler program to generate a custom.plx file for the CUSTOM library
  7. Exit from Oracle Forms Developer.
  8. Verify that your file generated successfully. If path name is left blank the file will be generated in c:\orawin\bin (or platform equivalent). Move it to AU_TOP/resource.
  9. Retry it out from the Oracle Applications Navigator.
Sample
Modify the code CUSTOM package body as follows in the appropriate sections
procedure event(event_name varchar2) is
form_name varchar2(30) := name_in(‘system.current_form’);
block_name varchar2(30) := name_in(‘system.cursor_block’);
item_name varchar2(30) := name_in(‘system.cursor_item’); 
Begin
if (form_name = ‘OEXOEORD’and block_name = ‘ORDER’) then
   if LENGTH(name_in(‘ORDER.CUST_PO_NUMBER’)) > 3 then
     fnd_message.set_name(‘FND’,’Cust PO Number should be less than 4 digits’);
     fnd_message.Error;
     RAISE FORM_TRIGGER_FAILURE;
   End if;
End if;
End Event;
Output
If the customer PO Number in sales order form has less than 4 digits the form will not populate any error message. If the customer po number field has more than for 3 digits the error message will be populated.
Retry it from following steps:
1. Open the Application Navigator 
2. Navigate to Order Management Responsibility 
3. Open the Sales Order Form 
4. Enter the values in Custom PO Number field with 4 digits
5. While navigating to next field the following error message pops up   
Cust PO Number should be less than 4 digits

No comments:

SHRD0014: GLLEZL - process exiting with failure

  SYMPTOMS Journal Import completes with the following error: Error ------ ORA-01653 : unable to extend table GL.GL_IMPORT_REFERENCES ORA-01...