Greetings all:
The basics:
ORACLE APEX 5.1.0.00.45
ORACLE Database 12.1.0.2.0 Production
We just went through the exercise of converting all of our 4.2.6.00.03 APEX applications to 5.1.0.00.45, and most everything is up and running fine as it should. However, this one particular application fell through the cracks somehow, and it was never tested in the lower environments before production was stood up. When the users of this app logged into the application after the final PROD move-up, functionality broke everywhere! The application did work perfectly in 4.2 however...
The main issue that the app is having deals with Dynamic Actions that execute a JavaScript Expression. There are hundreds of these Dynamic Actions on many text item fields, mostly with the Event of "Lose Focus" or "Change", with Actions of "Set Value". Calculations are being done in these text items that set value in another display item field. The calculations in the JavaScript Expression look something like this:
------------------------------------------------------
var l_rtn =
formatNumber($v('P220_LN_AMT')) +
formatNumber($v('P220_ORE_AMT')) +
formatNumber($v('P220_ADV_AMT')) +
formatNumber($v('P220_OTH_AMT'))
;
formatCurrency(l_rtn);
-----------------------------------------------------
formatCurrency is a function that exists on global page 0, residing in Pre-Rendering -> After Header -> Regions -> Share JavaScript region (type of "Static Content", the code in the "Text" box):
----------------------------------------------------
function formatCurrency(num) {
//Remove formatting Characters
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}
</script>
----------------------------------------------------
The issue we are having is that when this app is executed in APEX 5.1, the Dynamic Actions will not fire. Even if I put an Alert and the top of the Javascript code, the Dynamnic Action just does not fire.
All of the types of Dynamic Actions that do not execute a JavaScript Expression do work fine.
Another note: This app was built in APEX 3.X. The compatibility mode is set to Pre 4.1. I've tried all compatibility modes but does not solve the issue. The theme used is a custom theme, but resembles theme 16.
As anyone experienced this issue before? Any thoughts about this?
Thanks for your help,
Stan