This content has been marked as final. Show 8 replies
If you created a master detail relationship based on the primary key (HEADER_ID) then once the master is populated, forms will automatically populate the detail record with that same value. You should be able to open the property pallet of the DETAIL.HEADER_ID and see the MASTER.HEADER_ID value in the "Copy Value from Item" property.1 person found this helpful
Thanks for the reply
Yes the relationship is created on the basis of primary key of Header_id and Yes in the detail fiedl Copy from I can see the reference of master table primary key, but still in the detail table foreign key is going as null and is not getting value of the primary key in the master table.
any further idea?
What trigger are you using the create the HEADER_ID? I assume the PRE-INSERT trigger on the MASTER block?
If you open the MASTER - Relations node and look at the property pallete for the MASTER-DETAIL blocks you are talking about - what is the "JOIN CONDITION" value - HEADER_ID?
Trigger for the table ,
before insert on master
for each row
select seq.nextval into :new.header_id from dual;
and the join condition for the master detail block is
and on the pre-insert trigger of master data block there is only one line to update the WHO columns in the APPS tables.
Instead of using a database trigger, use the PRE-INSERT trigger in the master data block to populate the HEADER_ID.
In the PRE-INSERT trigger you would have a line like:
When you do that in the PRE-INSERT trigger it will will populate the item in the MASTER block which will in turn populate the item in the DETAIL block(s).
select seq.nextval into :MASTER.HEADER_ID from dual;
but i am not showing the header_id column on the master block, is it ok ? or i need to place the header_id on the master block , only then it will populate the master and related detail record?
You should have a HEADER_ID item in the MASTER block but it does not need to be displayed on the Canvas for the users to see.
thanks for all your help , its working like a charm now.