Translate

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:

First:
Set all relevant columns to: 


Query only: Yes - Primary Key: No


















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

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


Thats it. Good luck!

Keine Kommentare:

Kommentar veröffentlichen