Oracle APEX 24.1.6 | Oracle DB 19c
Hi, I have a Normal Page with a Form Region. The Form Region has a sub region of type Interactive Grid. The IG manages a table that is a “child” table of the table managed by the Form Region. I'll say that the Form Region is tied to table PARENT_TBL and the IG is tied to table CHILD_TBL.
CHILD_TBL has a column that is a FK to PARENT_TBL, we'll call it CHILD_TBL.PARENT_ID. It is equal to PARENT_TBL.ID. CHILD_TBL.PARENT_ID is mandatory (not null). The problem is when I go to create a record of type PARENT_TBL, I'm passing NULL to PARENT_TBL.ID. Then, I am unable to populate CHILD_TBL.PARENT_ID in the IG, because, well, PARENT_TBL.ID is null.
For the Form region, I have an After Submit computation for PX_ID that gets the appropriate value of PARENT_TBL.ID to submit.
But I have had trouble figuring out how to get this value assigned to the 1 or many possible “child” records CHILD_TBL.PARENT_ID column (note that there could also be 0 child records).
I've played around with the idea of sending in the value of PARENT_TBL.ID to the page to begin with, but then this ruins all my logic around CREATION vs. DELETION which is based on that Page Item / Field being NULL or NOT NULL. I could make another Page Item that strictly represents whether the Form should be a create form or save form, but, I'm hoping there is something I'm overlooking.
Is there a (declarative) way to get the CHILD_TBL.PARENT_ID populated with the value generated in the PX_ID after submit computation?