20
On August 4,2007 Page 1 of 20

Custom PLL

Embed Size (px)

DESCRIPTION

custom

Citation preview

Page 1: Custom PLL

OnAugust 4,2007

Index

Page 1 of 18

Page 2: Custom PLL

S.No Content page

1. Introduction 32. What It Is 33. How It Works 34. Architecture Of The Custom Library 45. Commonly used events that are trapped using

CUSTOM.pll are4

6. What we can do by using CUSTOM.Pll 57. Custom Library Location 58. Customization Steps 59. Commands to compile 510. How Multi-Developer do the changes at a time in

CUSTOM.pll5

12 Examples with Screen Shot 813 Conclusion 17

Page 2 of 18

Page 3: Custom PLL

Through this document I am explaining what Is CUSTOM PLL, what is the use of the CUSTOM PLL and how it will work in forms. Here I mention how to customize the form using CUSTOM PLL. and also listed some of the limitations of CUSTOM PLL.Here I have given the example how to add custom code in CUSTOM. PLL.

What it is The CUSTOM library allows extension of Oracle Applications without

modification of Oracle Applications Forms.

The custom library is an oracle forms PL/SQL library. It allows you to take full advantage of all the capabilities of the Developer suite of product and integrate your code directly with oracle application.

You can use the custom library for customization such as Calling other forms ,enforcing business rules and disabling fields that apply for your site .

What are the Methods available to do the changes in Forms

There are two methods available to do the changes in Forms CUSTOM.pll FORMS Personalization (only available from 11.5.10 onwards )

How it works In Oracle Apps every Form having form level triggers that makes call to

CUSTOM.pll, as shown in the following picture.

Page 3 of 18

Page 4: Custom PLL

Architecture of the custom library

APPCORE2 Form Library Standard triggers

CUSTOM Library Standard event triggers in the form call APPCORE2 routines that in turn call the CUSTOM Library .CUSTOM is attached to APPCORE2 and APPCORE 2 is attached to all forms. So, the Custom library is global to all of oracle applications.

Oracle applications sends events to the custom library . Your custom code can take effect based on these events.

You can use the custom library for customization such as Calling other forms ,enforcing business rules and disabling fields that apply for your site.

Page 4 of 18

Page 5: Custom PLL

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

What we can do by using CUSTOM.PllCUSTOM.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 fields2. Changing the List of Values in a LOV field at runtime.3. Defaulting values4. Additional record level validations5. Navigation to other forms.6. Enabling Special Menu

Custom Library Location The CUSTOM library is located in the $AU_TOP/resource directory .

Customization Steps

1. First move the Custom pll to the local directory.2. Then take backup of custom pll for this rename the CUSTOM.pll in

$AU_TOP/resource Directory .3. Open CUSTOM.pll through Form Builder and do the changes as per

business logic ,then compile the coding and save as CUSTOM .pll.4. Move the CUSTOM .pll to the location of $AU_TOP/resource directory .5. Then through telnet go to the location of $AU_TOP/resource folder and

compile the CUSTOM.pll .6. Then we can see the effect in the application.

Commands to compileTo convert from CUSTOM.pll to CUSTOM.plxf60gen module_type=LIBRARY module=CUSTOM userid=apps/apps

To convert from CUSTOM.pll to CUSTOM.pld:f60gen module_type=LIBRARY module=CUSTOM script=YES userid=apps/apps

To convert back from CUSTOM.pld to CUSTOM.pll ( after having edited the text pld file )f60gen module_type=LIBRARY module=CUSTOM parse=YES userid=apps/apps

Page 5 of 18

Page 6: Custom PLL

How Multi-Developer do the changes at a time in CUSTOM.pll

Steps:

1.Create .pll library for the form you want to customize example: Package Body: PACKAGE BODY XXXXXAPXVDMVD

ISPROCEDURE event (event_name VARCHAR2) ISBEGINIF event_name = ‘WHEN-NEW-FORM-INSTANCE’ THENSET_ITEM_PROPERTY(‘VENDOR_TYPE_DISP’,REQUIRED,PROPERTY_TRUE);END IF;END event;END XXXXXAPXVDMVD;

2.Attach your .pll to CUSTOM.pll.

3.Call to your new .pll to CUSTOM.pllPackage Body of CUSTOM.pll

Form_name varchar2(30) := name_in(‘system.current_form’);BeginIf form_name = ‘XXXXXAPXVDMVD’ THENxxxxxapxvdmvd.event(event_name);Elsif form_name = ‘XXXXXOEXOEORD’ THENxxxxxoexoeord.event(event_name);end if;end event;

Page 6 of 18

Page 7: Custom PLL

Custom.pll Screen Shot:

Page 7 of 18

Page 8: Custom PLL

Coding area in Custom pll

Example :

1. Change the label of a field, Enabling/Disabling the fields and Make a field mandatory.

Code:procedure event(event_name varchar2) is form_name varchar2(30) := name_in('system.current_form');block_name varchar2(30) := name_in('system.cursor_block');begin IF event_name = 'WHEN-NEW-FORM-INSTANCE' THEN IF form_name = 'POXPOEPO' and block_name = 'PO_HEADERS'

Page 8 of 18

Page 9: Custom PLL

then set_item_property('PO_HEADERS.AGENT_NAME',required,property_true); set_item_property('PO_HEADERS.VENDOR_NAME',PROMPT_TEXT,'Joice Supplier'); set_item_property('PO_HEADERS.VENDOR_SITE_CODE',ENABLED,property_false); END IF; END IF;end event;

Screen Shot:

Responsibility : Purchaing, vision operations (USA)Navigation : Purchase Orders Purchase Orders

Label Name : Supplier after changes Label Name : Joice SupplierLable Name : Site after changes Enable properties false of the Site.

Label Changed Enable Property false here

2. Create Dynamic LOV procedure event(event_name varchar2) is FORM_NAME VARCHAR2(30) := NAME_IN('system.current_form'); BLOCK_NAME VARCHAR2(30) := NAME_IN('system.cursor_block');

Page 9 of 18

Page 10: Custom PLL

QUERY_MODE VARCHAR2(30); RG_NAME VARCHAR2(40) := 'AP_ACCOUNT_TYPE'; ERRCODE NUMBER;

BEGIN IF (EVENT_NAME='WHEN-NEW-ITEM-INSTANCE' ) THEN IF (FORM_NAME='APXSUMBA' ) AND (BLOCK_NAME='ACCOUNTS') THEN ERRCODE:= POPULATE_GROUP_WITH_QUERY('AP_ACCOUNT_TYPE' , 'SELECT DISPLAYED_FIELD FROM AP_LOOKUP_CODES WHERE LOOKUP_TYPE= ''BANK ACCOUNT TYPE'''); IF ERRCODE=0 THEN SET_ITEM_PROPERTY('ACCOUNTS.BANK_ACCOUNT_TYPE',LOV_NAME ,'AP_ACCOUNT_TYPE'); ELSE SET_ITEM_PROPERTY('ACCOUNTS.BANK_ACCOUNT_TYPE',ENABLED ,PROPERTY_FALSE); END IF; END IF; END IF; end event;

Screen Shot:

Responsibility : Payables, vision operations (USA)Navigation : Setup PaymentBank Execute the Query (Ctrl+F11) Click Bank Accounts we can seen the window, in this bank account type is used for dynamic lov.

Before Customization in bank account type in payables Responsibility the screen shot is like this . Lov value are (BANK,C/C,CHECKING,CORPORATE,CURRENT)

Page 10 of 18

Page 11: Custom PLL

After the customization the list of values are changed.

Responsibility : Payables, vision operations (USA)Navigation : Setup PaymentBank Execute the Query (Ctrl+F11) Click Bank Accounts we can seen the window, in this bank account type is used for dynamic lov.

After Customization in bank account type in payables Responsibility the screen shot is like this . Lov value are populated like this (BANK, CHECKING,CURRENT,FRANCIS,JOICE)

Page 11 of 18

Page 12: Custom PLL

3. Special Menu and ZOOM calling other forms ZOOM Enable: function zoom_available return boolean is form_name varchar2(30) := name_in('system.current_form'); block_name varchar2(30) := name_in('system.cursor_block'); begin if (form_name = 'POXPOEPO' and block_name = 'PO_HEADERS') then return TRUE; else return FALSE; end if; end zoom_available;Event Call:procedure event(event_name varchar2) is mi_id menuitem;form_name varchar2(30) := name_in('system.current_form');block_name varchar2(30) := name_in('system.cursor_block');P_Vendor_id number;param_to_pass1 varchar2(255); param_to_pass2 varchar2(255);l_vendor_name varchar2(250); BEGIN mi_id := find_menu_item('SPECIAL.SPECIAL15'); IF form_name = 'POXPOEPO' and block_name = 'PO_HEADERS' then app_special2.instantiate('SPECIAL15', 'Calling Supplier Form'); set_menu_item_property(mi_id, displayed, property_true); set_menu_item_property(mi_id, enabled, property_true); ELSE

Page 12 of 18

Page 13: Custom PLL

set_menu_item_property(mi_id, displayed, property_false); END IF; IF (event_name = 'SPECIAL15' or event_name = 'ZOOM') THEN Fnd_message.clear;

Fnd_message.set_string('Very GOOD Joice Supplier Forms is coming --->>'); Fnd_message.show;

P_Vendor_id := name_in('PO_HEADERS.VENDOR_ID'); fnd_function.execute(FUNCTION_NAME=>'AP_APXVDMVD', OPEN_FLAG=>'Y', SESSION_FLAG=>'Y', OTHER_PARAMS=>'VENDOR_ID="'||to_char(P_Vendor_id)||'"' );

END IF;end event;

Screen Shot:

Enabling Zoom button :With Zoom, we can pass parameters from calling form to called form. In our case, I am passing the SUPPLIER NAME(Joice Supplier is the field Name) to the Supplier form, in which the Supplier Name’s corresponding data is fetched and displayed.

Responsibility : Purchaing, vision operations (USA)Navigation : Purchase Orders Purchase OrdersEnable : ZOOM Button.

Page 13 of 18

Page 14: Custom PLL

ZOOM BUTTON ENABLED

Page 14 of 18

Page 15: Custom PLL

ZOOM BUTTON CLICK

Before going to call the supplier form message display

Page 15 of 18

Page 16: Custom PLL

After the message the supplier form opens.

Sub menu Example:

In purchasing super user I enable one submenu under the tools menu . The name of the sub menu name is “Calling Supplier Form”, When we click this ,it will call supplier form.

Responsibility : Purchaing, vision operations (USA)Navigation : Purchase Orders Purchase Orders

Choose menu : ToolsCalling Supplier Form

Page 16 of 18

Page 17: Custom PLL

Page 17 of 18

Page 18: Custom PLL

Conclusion:

I think every body (Form developer) learned Custom.pll after going through this document . If you have any doubt and clarification send your feed back and comments to [email protected].

Page 18 of 18