Thursday 26 July 2012

Working on CUSTOM.pll with an example



Requirement: change the Executable field into uppercase within the Concurrent Program Executable screen

Follow these steps to make the Executable field uppercase using CUSTOM.pll:

1.    Enable show custom events: Log in to the Application Developer responsibility and enable Show Custom Events. Check the blog post for enabling custom events: http://oracleapps4u.blogspot.in/2012/03/how-to-enable-custom-events-for-oracle.html

2.    Gather information: A message box will appear when this form is opened, indicating that the form name is FNDCPMPE, the block name is FND_EXECUTABLES, the field name is USER_EXECUTABLE_NAME, and the event name is WHEN-NEW-FORM-INSTANCE. Note down the names of these components as these will be required in programming CUSTOM.pll. To double-check the name of field, navigate to the Executable field and use the Help/Diagnostics/Examine menu to see the name.

3.    Write code in CUSTOM.pll: Open Oracle Forms Builder, highlight PL/SQL Libraries, and navigate from the menu to File | Open. Open the CUSTOM.pll file and expand the nodes. Within the node Attached Libraries, you will see FNDSQF and APPCORE2. Write your logic in a procedure called event, using the following sample syntax:

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 form_name='FNDCPMPE' then
if event_name='WHEN-NEW-FORM-INSTANCE' then
app_item_property2.set_property('FND_EXECUTABLES.USER_EXECUTABLE_NAME',CASE_RESTRICTION, UPPERCASE);
end if;
end if;
end event;

OR you can even write your extensions in a package.event(event_name) and call this procedure in package body of custom.event.

After making the programming changes to CUSTOM.pll, scroll down to the bottom of the package body Custom and make these changes to the version history of CUSTOM.pll:

This code should appear as a sublisting under #3fdrcsid('$Header: CUSTOM.pld 120.1 2009/03/03 18:43:00 appldev ship $');

4.    Transfer CUSTOM.pll to $AU_TOP/resource: Log in to the forms server and change the directory to $AU_TOP/resource. Ensure you have a backup of CUSTOM.pll either in the source control system or on the file system. Next, transfer CUSTOM.pll from your desktop to $AU_TOP/resource.

5.    Generate CUSTOM.pll: Use the command frmcmp_batch, replacing the apps password with the relevant value on your system. After running this command, CUSTOM.plx will be created in $AU_TOP/resource:

cd $AU_TOP/resource
##For R12 use frmcmp_batch
frmcmp_batch module=CUSTOM.pll userid=apps/appspassword output_
file=./CUSTOM.plx compile_all=special module_type=LIBRARY
batch=yes
##For 11i Use f60gen command as shown below
f60gen module=CUSTOM.pll userid=apps/appspassword output_file=./
CUSTOM.plx module_type=LIBRARY

6.    Test your changes: Log out and log back in to the Concurrent Program Executable screen. You will notice that it is no longer possible to enter the concurrent program executable name using lowercase letters.

No comments:

Post a Comment