I have Master detail form, in the Master Data Block I have Primary Key Header_ID and this is generated through trigger on the master table, and this field is in the data block but is hidden on the canvas , this Header_ID is foreign key in an other table, on form I have created the master detail form and also created the proper relationship. now when new record is inserted, the Header_ID in the master table is populated properly while in the detail table it is going as NULL. I dont have any idea how to resolve this issue, any help will be appreciated
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.
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.
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?