Saturday, 10 August 2013

Oracle APEX - Build Options

Build options are named shared components. Build options allow you to conditionally render and execute objects in APEX. They are either INCLUDE or EXCLUDE for the entire application and can only be changed within the Application Builder. Build options don’t affect what is included in the application, just what is executed or displayed at run time. A better way of thinking about the status options/values would be to treat them as an enable/disable option – basically they are letting you switch pages or components on or off.

Their uses?
When the application is exported & imported, the Build Option can also be set to either INCLUDE or EXCLUDE a page or component eg INCLUDE in development but EXCLUDE in production

As a way of determining an applications functionality eg INCLUDE for Evaluation copy but EXCLUDE for a full copy

Sometimes during development (or even production) there is the requirement to “comment out” a component maybe because of a change of business logic the component doesn’t work or is unnecessary. Rather than remove the component, or set the “Condition Type” to “Never" either of which could have a knock on effect to something else you could use eg INCLUDE for non-commented out stuff but EXCLUDE for the commented out things

You may have certain components that you only want to run when debugging eg INCLUDE when debugging but EXCLUDE when running normally.

How to create them?

Go to the "Shared Components" section of your application and under the "Logic" section click on "Build Options". Next click on the "Create" button.

Check that the right application has been selected, give the build option a descriptive name, select it's status ie Include or Exclude, set the default in export value (so when this application is exported this is the value that the build option is set to) and finally add some descriptive comments. Click on the "Create" button.

How to use them?
This build option can now be associated to any number of application components such as
pages - go to the edit page attributes and click on the "Configuration" link to show this

What you will see is that in addition to the "Production" option a negative has also been created. So in this example if I select "Production" against this page the page will be included at runtime where as if I choose "Not Production" it won't. So if the component is exclude it means that within the development environment, these pages are available but not at runtime. Likewise
when the application is exported, the components are present within the builder - but not available at runtime.

The build option can also be used for regions, buttons, items, processes, computations, validations, branches, tabs, breadcrumbs - in fact a whole bunch of things!

Where are these stored?
All build options are stored in the APEX view called APEX_APPLICATION_BUILD_OPTIONS.

No comments:

Post a Comment