Switch off CUSTOM.pll programatically
Yesterday someone asked me a very interesting question. The question was, how to turn off CUSTOM.pll programatically based on some condition. The idea behind this article is not only to provide solution to this question, but also to discuss another major limitation of forms personalization.
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 APP_CUSTOM_MODE made. If global variable APP_CUSTOM_MODE 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.
After turning of CUSTOM CODE we can see that Global variable value changes.
What are the two options to disable CUSTOM.pll programatically?
Option 1:- Use Forms Personalization
we can set the global variable off using Forms personalization. However, this step is required to be repeated for each FORM or FUNCTION
Note: The limitation of Forms personalization, is that you will need to implement this change for each and every FORM/Function separately
This 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.
Comments
Where i have to call this code.
Thanks
R aJaS
Thats driven by your requirement.
In the example above, I am calling this from WHEN-NEW-FORM-I NSTANCE
Thanks ,
Anil Passi
RSS feed for comments to this post