Home » Developer & Programmer » Forms » Forms - ~Master/Detail
Forms - ~Master/Detail [message #157437] Thu, 02 February 2006 07:53 Go to next message
Safeeq.S
Messages: 100
Registered: October 2005
Location: Bangalore
Senior Member

Hi,
I have a Master/Detail form in there is a column delivery note. If a enter something in the delivery note it has to be copied to deliverynote column in the detail form.
Similarly if i clear the delivery note in the master block, the column in the detail should also get cleared.
how to accomplish it??
Re: Forms - ~Master/Detail [message #157468 is a reply to message #157437] Thu, 02 February 2006 09:41 Go to previous messageGo to next message
mail2me
Messages: 5
Registered: February 2006
Junior Member
in master block text item u can write a trigger WHEN_VALIDATE_ITEM

:DETIAL.DELIVERY_NO := :MASTER.DELIVERY_NO;


IT THINK THIS SHOULD SOLVE YOUR PURPOSE

THE FOLLOWING TRIGGER WILL BE FIRED WHEN CURSOR MOVES TO SOME OTHER ITEM
Re: Forms - ~Master/Detail [message #157471 is a reply to message #157468] Thu, 02 February 2006 11:07 Go to previous messageGo to next message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
I have some comments on this:

1) A when-validate-trigger should be used to VALIDATE things. If you want to do things like this use the post-item-trigger. It is the surest way to confusion/disaster to misuse a trigger to do something that does work, but for which it was not intended.

2) If this item you copy is not a primary key, why is it in both tables? This is a bad design of the db. Use the relations item in the datablock to 'relate' the child to the parent, so Forms will do your work. ( and correctly!) And of course you will never, ever change the PK, won't you?

3) for the 'clearing': what is this suppose to mean? You want to completely throw away child row or just one item in this row? See point (1) why this is a bad design.

Re: Forms - ~Master/Detail [message #157790 is a reply to message #157471] Mon, 06 February 2006 00:56 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I agree most strongly with RJ.Zijlstra. Please go back to your design and make sure that your master-detail design logic is sound. Then use the Forms wizards to create your two blocks and the 'relation' that joins them. Forms will do all the work for you, but you must have a viable design structure from which to start.

David
Previous Topic: Get Environment variable of client machine
Next Topic: Not showing PL/SQL editor
Goto Forum:
  


Current Time: Fri Sep 20 05:43:01 CDT 2024