Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserted record to be seen on detail along with master 1

Status
Not open for further replies.

nagornyi

MIS
Nov 19, 2003
882
0
0
US
It's Form 6i.
I have master and detail sections populated froom the same table. Master displays just several fields in tabular, while Detail displays full field set in the form layout for the selected master one. When I click Insert Records button, detail records spread out giving space for the new record. However, the detail record still displays the old one. I would like:
1) On record insert, the Detail woudl become all blank, ready for new input
2) When typing in or editing fields in Master, same typing or editing would simultanuosly take place in Detail (for those fields common in Master and Detail)
3) Vise versa: editing Detail would immediately reflect in Master
 
#1 - You need 2 separate blocks (both based on the same table) to be able to insert a row in one block while leaving the other displayed. Only one block should be updateable though or you will have locking problems.

#2 - Have you tried using synchronized fields (formerly called mirror fields)?

#3 - A detail block should not update a master block.

The design sounds incompatible with good forms design. Can you post your requirements? Maybe we can come up with a good solution.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
#1. The problem is that on insert the detail block displays key field of the previous record, while other fields are blank (as it should be for the new record)

#2. Synchronize propery allows only to mirror fields of the same data block, while I'd like to do that between blocks.
 
#1 - Does the detail block have a relationship that values the key field from the master? If so, remove the relationship on that field and hardcode the relationship in the WHERE clause.

#2 - Can't imagine doing this, but it sounds like you will have to code PRE-ITEM and POST-ITEM triggers that value their counterparts in the other block if the values are not the same.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
#1 Yes, there is a relation in the Master block created in the Wizard to tie to the Detail block. But how do I replace it with the WHERE clause?
 
The INITIAL VALUE property of the key item in the detail block refers back to the key in the master. That would need to be removed. Then on the WHERE property of the detail block you would put something like:
Code:
DTL_KEY = :MSTBLK.MSTR_KEY
If you remove the relationship, then you would also have to code triggers for block coordination. For instance, if the user goes to another record in the master block, you would have add to code to go to the detail block and execute_query. In the old days we had to code all the block coordination. The along came the relationships that automatically generate the triggers that keep the blocks in synch. Take a look at them before deleting the relationship.

This type of form design is going to be difficult. Is the table structure the problem because it is not normalized? I am sure if I knew a bit more I could help solve this problem. I have learned much in the Oracle Reports forum from you, I would be happy to take a stab at this to return the favor.
 
Thank you very much for the input. I also learned a lot from your postings, including this one. For now, as it is not possible to synchronize blocks in the mirror mode, I am thinking of hiding Details while entering new record into Master, and then requering and showing it again after saving. I'll definitely be back with more questions. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top