"Comment out" an Oracle APEX Process, Validation, Branch, …

Sometimes during development there is the requirement to “Comment out” a Process, a Validation, … in an Oracle Application Express (APEX) application. To skip a step which doesn’t work anymore, or where a user says he doesn’t need that anymore but where you are sure that next week you are going to add it again…

In Oracle Forms that’s quite simple. You just have to rename the trigger to use underscores (eg. PRE-QUERY to PRE_QUERY) and the trigger doesn’t fire anymore. But how can you do that in Oracle APEX?

Sure you can comment out the PL/SQL code, if it’s a PL/SQL process, but don’t forget the NULL; so that you still have a valid code. But what to do for the more declarative process/validations/branches/…? You could set the “Condition Type” to “Never”, but that will change probably an existing condition. And afterwards when you want to enable it again, you have to know what has been set before.

It think there is a much more elegant way to do it. It’s called the “Build Option”.

  1. Go to Shared Component\Build Options and create a new one with the name “Commented out”.
  2. Set the Status to “Exclude”

Now you are able to “disable” any object in your Oracle APEX application by assign the new build option with the “Configuration\Build Option” property. This property can be set for almost any object in Oracle APEX.

And the good news is, there is even a report which shows you all the objects which are “Commented Out”. Have a look at the “Utilization” tab in Shared Components\Build Options.

7 thoughts on “"Comment out" an Oracle APEX Process, Validation, Branch, …

  1. thanks for the tip

    isn’t it that this functionality can be achieved most of the times with conditional display-Never ?

    some more questions:
    * from the readability point of view which is more developer friendly for you?: the utilization tab or seeing Never on the ( Page definition )
    * which would be faster on running?: disabling by build options
    or disabling by condition-never
    or both

  2. Hi Mihaï,

    just noticed that I have made a typo in the above text. Instead of “None” it should have been “Never”. I have fixed that.

    So see above why I wouldn’t use the condition type. About the performance. Should be the same, because both are fixed wired checks in the APEX rendering code and remember, it should always be the exception that objects/code is commented out so you will hardly be able to measure a difference between this two methods.

    About “readability”: There a pros and cons. When you are going to deploy your application, the “Utilization” tab gives you a quick quality check to verify if there is code which shouldn’t be commented out. For the conditions you can’t do that. Pro for the condition is that you see it immediately on the page overview that the object/code is not used. BTW, I will add a highlighting for the “Build Option” to the APEX Builder Plugin as I did for the “Comment” field to make it better visible.


  3. G’day Patrick,

    I’ve been experimenting with the build option, and I can’t get it to behave as expected. Given the following directions
    – create ‘exclude’ build option under shared components
    – assign build option to a page (and specific button to be sure)
    – export the application
    – import as separate id, check the page & button do not exist
    – page & button exist!

    I’ve also had a play with the build option in the supporting components section, checking the prompt for build checkbox – hoping perhaps I may get prompted somewhere during import.

    I’m using Apex3.2.1 on 10gR2

    Any tips?

  4. Hi Patrick,
    Good to see a nice blog on Apex.
    Iam a forms guy and I want to work on Oracle apex , So could you give me some directions which would reduce my learning curve.

    Thanks in advance for your help.
    Subramanian Kaushik Gurumoorthy

Comments are closed.