Sunday 23 April 2017

AUSOUG APEX 5.1 webinar series

Oracle APEX 5.1 webinar series

Australia/New Zealand ORACLE APEX webinars

Great speakers from USA, EU, AU and NZ

I am pleased to announce there is a huge interest not only among the speakers but also from the audience for this years 2017 AUSOUG APEX webinar series.
There is plenty of time for you to join us, please check AUSOUG Calendar for more details. First session is starting 27/04/2017 - registration.

Some of the speakers already confirmed

  • Dimitri Gielis, APEX RnD, Belgium
  • Tyson Jouglet, Skillbuilders, USA  
  • Scott Wesley, Sage Computing, Australia
  • Roeland Van den Eynde, APEX RnD, Belgium
  • Niels de Bruijn, MT AG, Germany
  • Oliver Lemm, MT AG, Germany
  • Aljaz Mali, Abakus Plus, Slovenia
  • Menno Hoogendijk, Qualogy, Netherlands
  • Matt Nolan, FOEX GmbH, Austria
  • .....more to come soon
in no particular order :)

More information on Hope to see you there.
Happy APEXing,

Monday 10 April 2017

APEX 5.1 migration - compatibility tips

APEX 5.1 migration

Our experience going 5.1

Compatibility mode issues

The day has come to upgrade your system to APEX 5.1. This is a short post about things we encountered along the way. 

This post covers for Desktop application template version errors that uses compatibility mode 4.2. 

Idea is to show case that even though it seems simple there might be more to it in terms of upgrade plans to 5.1.1 than you and I initially thought. 

For mobile template errors there will be a separate post. 

Please note that I will be updating it as things pop up so watch the space.

1. First on the menu:

Ajax JS calls causing:
Ajax call returned server error ORA-20987: APEX - Session state protection violation: This may be caused by manual alteration of a URL containing a checksum or by using a link with an incorrect or missing checksum. If you are unsure what caused this error, please contact the application administrator for assistance. - Contact your application administrator. for .

If you dig into debug mode you would get some more details where APEX was listing what page item this problem occurred for. Bottom of the problem was some page items had Security attribute Session State Protection set to Check sum required - Session Level and were used in AJAX calls which now cause security errors to be shown. Solution of the problem was to change this as:

2. problem had to do with Old Custom Theme template and application that was running in 4.x compatibility mode.

Apex 4.x compatibility apps have an issue with the home breadcrumb not substituting values rendered URL looks like this:

How to fix this? One way is to chance this breadcrumb template from:

To this:
There are other ways how to do call this JS fix but for clarity of the blog I used "After Last" section.
3. problem - Dialogs for applications running in compatibility mode 4.x version

Front dialog not at correct z-index – unable to click on it due to modal click blocker being in front. Selenium tests still worked fine.
How to fix this? Add CSS style to your template
body .ui-dialog.ui-front{z-index:1001 !important} 

4. problem - Interactive report Filter Issue for 4.x compatibility mode
When you select Action-> Filter, Chrome console throws this error and it does not display filter options dialog screen:

First hint was this was related to old Classic Date Picker functionality that has been decommissioned.

This was confusing as on this IR there was no usage of Classic Date Picker or anything like that nor did the page contain any page items that were Date Pickers. Plus some IR of the same application were working perfectly fine while few others failed. This indicated that APEX 5.1 LS libraries were not the cause of the problem otherwise it would not have worked at all, right?

Solution: After significant amount of hours investigating, what narrowed it down was a desperate page export and comparison between working and non working IR page.

Core cause of all problems had nothing to do with Classic Date Picker nor with any JQuery conflict. It came down to bad programming practice and simple region Static ID set by developers. Pages where Filter action had an issue had ID set something similar to: 

I guess you see the problem straight away. What this invalid ID did it eventually broke JS functionality of IR as it was trying to use ID to handle user interactions. Once we updated IDs to include no spaces and less characters things were back to normal. All IR Filter actions started working again.

Hard lesson learned here. Only hint to APEX would be to add a check to static ID that it has to be a valid HTML ID for DOM element. Please note that same IDs in APEX worked perfectly fine. 

5. problem - apex.server.process error

Uncaught TypeError: Cannot read property 'pageItems' of undefined
at i (desktop.min.js:10)
at h (desktop.min.js:10)
at Object.a.process (desktop.min.js:10)
at Object.handleJson [as success] (map_rbgassessment.js:232)
at i (jquery-2.2.3.min.js:2)
at Object.fireWith [as resolveWith] (jquery-2.2.3.min.js:2)
at z (jquery-2.2.3.min.js:4)
at HTMLScriptElement.c (jquery-2.2.3.min.js:4)
at HTMLScriptElement.dispatch (jquery-2.2.3.min.js:3)
at HTMLScriptElement.r.handle (jquery-2.2.3.min.js:3)

Scenario: simple application page using this AJAX call

apex.server.process ("deletePins");

For deletePins application process:
Solution was to rewrite the AJAX call:

apex.server.process ( "deletePins", {
x01: "test",
pageItems: ""
}, {
success: function( pData ) {
console.log("(done) deletePins ");;
} );
Seems like call back needs to have a success handler.

6. problem - Download is showing additional column with URL details

Report on a page had SQL query for the source

  SELECT '<a href="javascript:apex.confirm(''Do you want to return this organism as a member?'', ''REVIVE_' || CARRIER_ID
  || ''');"><img src="#WORKSPACE_IMAGES#red-delete.svg" alt="revive" title="Revive Member"></a>'............

Export / Printing
Include In Export / Print
Yes/No -> set to NO defaulted to YES

7. problem - Internet explorer issue with Interactive reports and tabs

<meta http-equiv="X-UA-Compatible" content="IE=8" />
Check if your templates include the line above. This caused IE application to show heaps of related issues in DOM inspector.

Object doesn't support property or method 'submit'
and few others. By removing the line in yellow things were back to normal. Application was running template 24 in 5.0 compatibility mode. 

8. problem - Minor CSS class/DOM changes between APEX 5 and APEX 5.1

This caused some testing scripts to fail. Once you inspect the DOM you would notice small DOM changes and all you have to do is update your test scripts.

This is all for now. Over and out.

Last Update 27/04/2015

Latest update 03/05/2017

Saturday 1 April 2017

Oracle APEX 5 - Report template tip

APEX 5 and custom report templates

APEX Reports on a next level

Fiddly default setting - "Sortable"

Small things make life happy! but sometimes it can take 4 eyes looking for obvious and cost you hours of your time before you found a solution. Does it sound familiar?

First thing that comes to my mind when someone mentions Custom report templates in Oracle APEX is the name of fellow APEXer - Jorge Rimblas. Why?

So many times Jorge showcased how great your reports can be if you put minimal efforts into them. Staring from very simple examples then spicing it up and bringing it to whole new level of presentation and yet still keeping it simple which is the most important thing.

This blog is not about how to create a custom report template but to showcase one small settings that you need to be aware of to save yourself some time.

Please by all means I highly recommend reading through and checking Jorge's blog for any further tips how to create your first report templates.

Situation: we created a template looking like this that is now able to run from a query.
Excellent work give your self a pat! :D

Next step is you try to add another field to the report and then things go bad. What I mean by it?

Check out this example:

I have a report with set of nicely looking blocks that contain some formatted text. All beautified and made fancy by CSS.

Idea is to present them in order 1 to n.

What happened as soon as I would add new column to my SQL query - my report elements would be sorted by something other than what I planned for.
OK it was clear as a day that it was an issue with 'sort by' but what I could not pick up is why it was showing up when I am simply defining a new column.

Then thanks to the help of second pair of eyes and valuable APEX experience of Skillbuilders (thanks Tyson) I was pointed to report column property setting called
Of course as soon is was set to No things were back to normal. This thing is now clear as day but at that moment information simply was not getting to my brain.

That is why I decided to log it here so that next time I know what to look for.