SlideShare a Scribd company logo
Copyright © 2019 APEX Consulting
APEX Bad Practices
APEX Bad Practices
<bragging>
APEX Bad Practices
</bragging>
3 Membership Tiers
• Oracle ACE Director
• Oracle ACE
• Oracle ACE Associate
bit.ly/OracleACEProgram
500+ Technical
Experts Helping
Peers Globally
Connect:
Nominate yourself or someone you know: acenomination.oracle.com
@oracleace
Facebook.com/oracleaces
oracle-ace_ww@oracle.com
APEX Bad Practices
APEX Bad Practices
APEX Bad Practices
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
Get organised
Naming stuff
APEX Bad Practices
APEX Bad Practices
APEX Bad Practices
APEX Bad Practices
Need a Page Item Value on other pages?
Use an Application Item
Use P0_EMPNO
Use P1_EMPNO
APEX Bad Practices
$(“#P1_EMPNO”)apex.item(“P1_EMPNO”)
APEX Bad Practices
Divide and conquer
A few Applications
with a lot of Pages
A lot of Applications
with a few Pages
MASTER
SEED
subscription
APP 1
APP 2
APP 3
copy
subscription subscription subscription
✅
❌
❔
❌
❌
❌
❌
✅
✅
✅
❌
❌
❌
✅
✅
✅
❌
❌
❌
❌
❌
❌
❌
✅
❌
✅
❌
✅
✅
❌
❌
❌
❌
❌
❌
Page 0
Unsubscribe
NEVER Unsubscribe
APEX Bad Practices
Don’t put your files
in the APEX directories
APEX Bad Practices
APEX Bad Practices
/usr/local/tomcat/webapps/i
/usr/local/tomcat/webapps/
mycode
/mycode/js/myJsFile.js
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
Dude, where’s my code?
APEX Bad Practices
Process
Region / Item Source
Condition
Read Only Condition
Item Default
Dynamic Action
Validation
Where CAN you put your PL/SQL?
Where SHOULD you put your PL/SQL?
Reusable
Testable
Compiled
Dependencies
Some more remarks
regarding PL/SQL
APEX Bad Practices
select *
from my_big_table
where field = v('P2_EMPNO')
select *
from my_big_table
where field =
( select v('P2_EMPNO')
from dual )
with param as
( select v('P2_EMPNO') empno
from dual )
select *
from my_big_table
, param
where field = param.empno
with param as
( select /*+ MATERIALIZE */
v('P2_EMPNO') empno
from dual )
select *
from my_big_table
, param
where field = param.empno
APEX Bad Practices
APEX Bad Practices
FORMAT MASK
APEX Bad Practices
render / submit / ajax
APEX Bad Practices
APEX Bad Practices
APEX Bad Practices
Beware of
undocumented
features
APEX Bad Practices
APEX 5
APEX 18
:APXWS_SEARCH_STRING_1
:APXWS_EXPR_1
:apex$f1
https://roelhartman.blogspot.com/2016/07/prevent-general-row-based-search-in.html
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
And what about
JavaScript …
APEX Bad Practices
Page “JavaScript section”
Page header / footer
Region header / footer
Item Pre / Post Text
URL target
Dynamic Action When / Condition
DA Action : Execute JavaScript Code
Where CAN you put your JavaScript?
Where SHOULD you put your JavaScript?
In a file (on your network / static app file)
(reference in the User Interface Details)
In a Plugin (JavaScript file)
Roels Rule : No JavaScript anywhere else
The code is more what you'd call "guidelines" than actual rules
How should you code your JavaScript?
$(“#P1_EMPNO”)

or

apex.item(“P1_EMPNO”)
APEX Bad Practices
APEX Bad Practices
How should you code your JavaScript?
$v(“#P1_EMPNO”)

or

apex.item(“P1_EMPNO”).getValue()
How should you code your JavaScript?
$v(“P1_EMPNO”)

or

apex.item(“P1_EMPNO”).getValue()
APEX Bad Practices
APEX Bad Practices
Know your APEX JavaScript API’s
https://docs.oracle.com/en/database/oracle/application-express/19.1/aexjs/index.html
Beware of undocumented features
gReport
htmldb_Get
A lot of stuff in the Interactive Grid
Watch your plugins …
Beware of undocumented features
Beware of DOCUMENTED features
APEX Bad Practices
function render
( p_dynamic_action in apex_plugin.t_dynamic_action
, p_plugin in apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
is
l_result apex_plugin.t_dynamic_action_render_result;
begin
l_result.javascript_function :=
'function(){
openModal( this.affectedElements[0].id );
}';
return l_result;
end;
APEX Bad Practices
function render
( p_dynamic_action in apex_plugin.t_dynamic_action
, p_plugin in apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
is
l_result apex_plugin.t_dynamic_action_render_result;
begin
l_result.javascript_function :=
'function(){
openModal( this.affectedElements[0].id );
}';
return l_result;
end;
function render
( p_dynamic_action in apex_plugin.t_dynamic_action
, p_plugin in apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
is
l_result apex_plugin.t_dynamic_action_render_result;
begin
l_result.javascript_function :=
'function({
apex.theme.openRegion( this.affectedElements[0].id );
}';
return l_result;
end;
APEX Bad Practices
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
Miscellaneous
Dynamic Actions are cool
APEX Bad Practices
Page Process / Computation
APEX Bad Practices
Region refresh
Page refresh
Row refresh
function render
( p_dynamic_action in apex_plugin.t_dynamic_action
, p_plugin in apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
is
l_result apex_plugin.t_dynamic_action_render_result;
begin
l_result.javascript_function :=
'function(){
var myGrid = apex.region( this.affectedElements[0].id )
.widget().interactiveGrid("getViews").grid;
myGrid.model.fetchRecords( myGrid.getSelectedRecords() );
}';
return l_result;
end;
Get organised
Dude, where’s my
code?
And what about
JavaScript …
Miscellaneous
APEX Bad Practices
Copyright © 2019 APEX Consulting
Q& A@roelh
roel@apexconsulting.nl
http://www.apexconsulting.nl
@roelh
roel@apexconsulting.nl
http://www.apexconsulting.nl
Copyright © 2019 APEX Consulting

More Related Content

PPT
"Native" Apps with APEX and PhoneGap
PPTX
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
PDF
Module 2: Adding JavaScript to APEX Apps
PDF
Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript ...
PDF
Intro to JavaScript for APEX Developers
PPT
Oracle apex training | Oracle Application Application Express Training | Ora...
PDF
Oracleapex 150914085107-lva1-app6892
PPTX
JavaScript: Why Should I Care?
"Native" Apps with APEX and PhoneGap
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
Module 2: Adding JavaScript to APEX Apps
Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript ...
Intro to JavaScript for APEX Developers
Oracle apex training | Oracle Application Application Express Training | Ora...
Oracleapex 150914085107-lva1-app6892
JavaScript: Why Should I Care?

Similar to APEX Bad Practices (20)

PDF
OLD APEX and PL/SQL
PPTX
Beginner's Guide to APEX
PDF
Oracle Application Express and PL/SQL: a world-class combo
PPT
Intro to Application Express
PPTX
Oracle apex training
PPTX
Oracle Apex Intoduction.pptx
PPT
St Hilaire Ajax Start Odtug Nov 2009
PPTX
APEX Office Hours Interactive Grid Deep Dive
PDF
UNYOUG - APEX 19.2 New Features
PDF
Application Express - A web development environment for the masses - and for ...
PDF
Apexandfreeadboow19tues 190924225740
PDF
Oracle APEX, Oracle Autonomous Database, Always Free Oracle Cloud Services
PDF
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
PDF
Low Code Meets the Enterprise - Low Code AppDev with Oracle APEX
PDF
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
DOCX
Oracle apex course content
PDF
Apex atp customer_presentation_wwc march 2019
PPT
Oracle Application Express
PPTX
oracle-apex-forms-modernization-2023.pptx
PPT
Web Development In Oracle APEX
OLD APEX and PL/SQL
Beginner's Guide to APEX
Oracle Application Express and PL/SQL: a world-class combo
Intro to Application Express
Oracle apex training
Oracle Apex Intoduction.pptx
St Hilaire Ajax Start Odtug Nov 2009
APEX Office Hours Interactive Grid Deep Dive
UNYOUG - APEX 19.2 New Features
Application Express - A web development environment for the masses - and for ...
Apexandfreeadboow19tues 190924225740
Oracle APEX, Oracle Autonomous Database, Always Free Oracle Cloud Services
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
Low Code Meets the Enterprise - Low Code AppDev with Oracle APEX
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
Oracle apex course content
Apex atp customer_presentation_wwc march 2019
Oracle Application Express
oracle-apex-forms-modernization-2023.pptx
Web Development In Oracle APEX
Ad

More from Roel Hartman (20)

PDF
Wizard of ORDS
PDF
Tweaking the interactive grid
PDF
Docker for Dummies
PDF
A deep dive into APEX JET charts
PDF
My Top 5 APEX JavaScript API's
PDF
Mastering universal theme
PDF
APEX Developers : Do More With LESS !
PDF
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
PDF
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
PDF
APEX printing with BI Publisher
PDF
Troubleshooting APEX Performance Issues
PDF
Automated testing APEX Applications
PDF
5 Cool Things you can do with HTML5 and APEX
PDF
Striving for Perfection: The Ultimate APEX Application Architecture
PDF
XFILES, the APEX 4 version - The truth is in there
PDF
Done in 60 seconds - Creating Web 2.0 applications made easy
PPTX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
PPTX
Creating sub zero dashboard plugin for apex with google
PPTX
Integration of APEX and Oracle Forms
PPT
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Wizard of ORDS
Tweaking the interactive grid
Docker for Dummies
A deep dive into APEX JET charts
My Top 5 APEX JavaScript API's
Mastering universal theme
APEX Developers : Do More With LESS !
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
APEX printing with BI Publisher
Troubleshooting APEX Performance Issues
Automated testing APEX Applications
5 Cool Things you can do with HTML5 and APEX
Striving for Perfection: The Ultimate APEX Application Architecture
XFILES, the APEX 4 version - The truth is in there
Done in 60 seconds - Creating Web 2.0 applications made easy
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Creating sub zero dashboard plugin for apex with google
Integration of APEX and Oracle Forms
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Ad

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Unlocking AI with Model Context Protocol (MCP)
The AUB Centre for AI in Media Proposal.docx
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf

APEX Bad Practices