FOR I IN APEX_APPLICATION.G_F01.COUNT LOOP APEX_APPLICATION.G_F01(I) := <Return Key Into Item of Master> ; -- REPLACE PLACEHOLDER WITH ITEM NAME USING BIND VAR SYNTAX (:) END LOOP;
make sure you update the correct array in the PL/SQL process.
Also make sure that the "process row" process of the master ( which does the insert ) runs before the PL/SQL process and that in the properties of the "process row" process the field "return key into item" is filled with the primary key field of the master.
So steps should be :
1. Insert the master row and in this process return the inserted primary key back into the primary key field on your form
2. Update the foreign key field of all child records with the newly gererated primary key of the master ( this is done in the PL/SQL process ).