Freitag, 29. September 2017

APEX 5.1 - Interactive Grid - Edit - two tables

I like to share the following based on explanations in the APEX forum of Sven Weller
(Thanks so much to Sven !)

We can use the Interactive Grid (IG) Edit function also for Views... or for more than one table....

We have to consider, that only columns of the "driving" table can be edited. Otherwise you will get Javascript errors like:

Ajax-Call has Servererror ORA-20987: APEX - ORA-01779: cannot modify a column which maps to a non key-preserved table for submit.

The "key-preserved-table" is in other words the "driving" table.

In a master/detail scenario the the driving table" is the "detail table";
more than one "detail" record may occur for one "master " record 

(e.g. 1 order may have several detail items).
So in an IG one can only edit the columns of the detail items. 

The setup of the attributes of the respective column(s) of the driving (detail-) table is as follows:

Set all relevant columns to: 

Query only: Yes - Primary Key: No

Those columns you like to edit: set "Query Only: NO"

The Primary Key columns of the tables must be set to: YES -
(ofcourse for all other columns to: No)

Thats it. Good luck!

Field with textarea only 1 line high

Sorry for mixing german and english in this blog....

I found this very helpful:

Business case:
Input field with character counter needed - but one line high only:
(the character counter is only available in field type: textarea - not: text-field)

Tom W. found out the following :

it seems to me that the css attribute min-height overwrites the textarea-attribute rows (the value you enter in the property for the item).

By resetting the css the textareas height works like you would expect, e.g.

define in page properties -> css -> inline

textarea.textarea { min-height: 0px !important; }

Thanks Tom W. !

Good luck!

BTW: I use APEX 5.1

Mittwoch, 27. September 2017

NULL-WERTE - NULL-VALUES in Interactive Reports, Classic Reports

Altes Thema: NULL-VALUES

Nicht alle Spalten der Tabellen werden im täglichen Gebrauch mit Werten, speziell: "Zahlen" gefüllt.

Will man nun im Interactive Report "Berechnen" (über das Aktionen-Menü), kann es zu falschen oder gar keinen Ergebnissen führen, wenn das System "Null-Werte" (= "weiß nicht genau..") vorfindet. 

Workaround: Eine "0" explizit dort setzen, wo ein Null-Wert ist:

Befehl im Taschenrechner: NVL( AB,0) + NVL(AD,0) oder im


select NVL(PREIS,0) as Preis