Deploying Apex: showing an “Under Maintenance” web page

systemdown

I’ve added this script to our toolbelt for future upgrades. We have a friendly “System is under maintenance, sorry for any convenience” web page that we want to show to users while we run upgrades, and we want it to be shown even if we’re just doing some database schema changes.

So I took the script from here and adapted it slightly, here’s our version:

declare PRAGMA AUTONOMOUS_TRANSACTION;
  v_workspace CONSTANT VARCHAR2(100) := 'MYSCHEMA';
  v_workspace_id NUMBER;
 (more...)

Estimating Apex Development

You’ve finished the design for an Apex application, and the manager asks you “when will you have it ready to test”. You resist the temptation to respond snarkily “how long is a piece of string” – which, by the way, is often the only appropriate answer if they ask for an estimate before the design work has started.

chuck-norris-knows-how-long-a-piece-of-string-is-thumb

Since you have a design and a clear idea of what exactly this application will do, you can build a reasonable (more...)

Tabular Form – set default values with jQuery

tabular-form-default-jquery4

I have a simple tabular form with a numeric “sort order” column. I want the value of this column to be defaulted automatically, based on the maximum value of the rest of the records on the screen. Unfortunately the builtin Apex default type for columns in a tabular form can only be based on an Item, or a PL/SQL expression or function. I didn’t want to make a database call to get the maximum value (more...)

Apex CSV Import: “Data Loading Failed”

If you are using the Apex built-in Data Loading feature to allow your users to upload CSV files, you may have encountered this error. It’s not a particularly useful error, and the apex logs don’t seem to shed much light on the problem either – reporting only “ORA-01403: no data found” with backtrace ORA-06512: at "APEX_040200.WWV_FLOW_DATA_UPLOAD", line 4115 ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS_NATIVE", line 213 ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS_NATIVE", line 262 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN", (more...)

Remove punctuation from string using Javascript

I’m a morning person, and my mind is usually sharpest on Monday or Tuesday mornings, so these are the best times for me to work on fiddly javascript stuff. Today was one of those mornings and here are the results, just in case I want to refer back to them later on.

I had many items dotted around an Apex application where the user is allowed to enter “Codes” – values that must be uppercase (more...)