Thursday, 6 December 2018

Custom.PLL

The CUSTOM library allows extension of Oracle E-Business Suite without modification of Oracle E-Business Suite code. The CUSTOM library can use for customization such as Zoom (such as moving to another form and querying up specific records), enforcing business rules (for example, vendor name must be in uppercase letters), and disabling fields that do not apply for site.


STEPS

Step 1: Download the CUSTOM.pll from the server to local machine.
            /u04/maxprod/apps/apps_st/appl/au/12.0.0/resource
Step 2:  Open CUSTOM.pll in Form Builder. We will notice that the only attached library is FNDSQF.

Step 3:  Attach the APPCORE2 library so that the code in the CUSTOM.pll works. 
(To do that, first click on Attached Libraries and then click on the green plus icon on the left to open the Attach Library window. Browse for APPCORE2.pll on your local machine and attach it to CUSTOM.pll.
Once that is done, APPCORE2.dll will be displayed in the list of attached libraries.)

Step 4: In procedure event of the CUSTOM.pll body, comment out the following three lines
--Real code starts here
--begin
--null
--end evet

Step 5: and add the following code

formname varchar2(30);
blockname varchar2(30);

begin
IF event_name = 'WHEN-NEW-FORM-INSTANCE' THEN
IF FND_PROFILE.VALUE('USERNAME')='LOKANADHAM' THEN
BEGIN
COPY('Entering app_form.query_only_mode.','global.frd_debug');
COPY('YES', 'PARAMETER.QUERY_ONLY');
APP_MENU2.SET_PROP('FILE.SAVE', ENABLED,PROPERTY_OFF);
APP_MENU2.SET_PROP('FILE.ACCEPT', ENABLED,PROPERTY_OFF);
formname := NAME_IN('system.current_form');
blockname := GET_FORM_PROPERTY(formname, FIRST_BLOCK);
WHILE (blockname is not null) LOOP
IF (GET_BLOCK_PROPERTY(blockname, BASE_TABLE) is not NULL) THEN
SET_BLOCK_PROPERTY(blockname, INSERT_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY(blockname, UPDATE_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY(blockname, DELETE_ALLOWED, PROPERTY_FALSE);
END IF;
blockname := GET_BLOCK_PROPERTY(blockname, NEXTBLOCK);
END LOOP;
END;
END IF;
END IF;

end event;

Step 6: Save the CUSTOM.pll and transfer it back to the server.

Step 7:  Login to putty, go to /u04/maxprod/apps/apps_st/appl/au/12.0.0/resource.
             Compile it using the following command to genrate plx file from pll.

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

Step 8:  Login Application with user name(LOKANADHAM)

Step 9: Forms for all responsibilities will now become read-only for the LOKANADHAM user

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.

EVENTS PASSED TO THE CUSTOM LIBRARY

The CUSTOM library receives two different kind of events, generic and product-specific. Generic events are common to all the forms in Oracle E-Business Suite. These events are:

  • WHEN-FORM-NAVIGATE
  • WHEN-NEW-FORM-INSTANCE
  • WHEN-NEW-BLOCK-INSTANCE
  • WHEN-NEW-RECORD-INSTANCE
  • WHEN-NEW-ITEM-INSTANCE
  • WHEN-VALIDATE-RECORD
  • SPECIALn (where n is a number between 1 and 45)
  • ZOOM
  • EXPORT
  • KEY-Fn (where n is a number between 1 and 8)