Thursday 25 August 2011

Switch off CUSTOM.pll programatically

What is the requirement?
Lets say you do not want CUSTOM.pll to be invoked when a specific profile option "XX Disable Custom.pll" is set to Yes.
Effectively we need to be able to programatically switch of CUSTOM.pll


How do I programatically disable CUSTOM.pll ?
CUSTOM.pll gets called from APP_STANDARD package [in APPCORE.pll]. APP_STANDARD is effectively called from all the Oracle Apps Form Triggers. If you open appcore.pll, you will notice that within package app_standard, reference to global variable made. If global variable is set to OFF, then CUSTOM.pll does not get called.

How do I doublecheck that above holds true?
Use examine, in normal mode you will notice the value of this global variable as NORMAL


Turn custom code off using help menu, and then you will notice the value of global variable changing.



What are the two options to disable CUSTOM.pll programatically?
Option 1:- Use Forms Personalization


Note: The limitation of Forms personalization, is that you will need to implement this change for each and every FORM/Function separatelyThis limitation does not exist in CUSTOM.pll as we will see below.

Option 2:- Use CUSTOM.pll [yes CUSTOM.pll to turn off CUSTOM.pll conditionally]
IF event_name = 'WHEN-NEW-FORM-INSTANCE' THEN
    IF fnd_profile.value( 'GL_SET_OF_BKS_ID' ) = 999 THEN
         copy ( 'OFF' , 'GLOBAL.APP_CUSTOM_MODE' ) ;
    ELSE         copy ( 'NORMAL' , 'GLOBAL.APP_CUSTOM_MODE' ) ;
    END IF ;
END IF ;

So, CUSTOM.pll still rules in certain cases, as in this case whereby you wish to implement a logic spanning multiple forms with few lines of code.

No comments:

Post a Comment