Home » Developer & Programmer » Forms » master-details relationship.
master-details relationship. [message #175192] Thu, 01 June 2006 04:27 Go to next message
prase_pk
Messages: 40
Registered: July 2005
Location: india
Member
I have a problem.
I have two blocks A and B.A is the Master and B is the details block.

This is my scenario.
1.I insert a new record in A and then corresponding to this new record I insert some records in B.
2.Now I move to the A block and insert another record and corresponding to this new record I insert some records in B.
3.But now when I move back to the previous record,i dont have entries in the B block.
The user can enter records in the B block and make an entry corresponding to it in the A block also.

But if there are records existing and I modify them then its working fine.

I tried keeping commit in when-validate-record,post-record.etc... but dint help.What do I need to do?I am able to save only upto A block.Please suggest.

Re: master-details relationship. [message #175246 is a reply to message #175192] Thu, 01 June 2006 07:00 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
maybe the foreign key of the master will not be stored in the detail block.

did you generate the form with the wizard? then some triggers and the relationship had been created to synchronize master and detail block.

or did you create these triggers manually?

[Updated on: Thu, 01 June 2006 07:02]

Report message to a moderator

Re: master-details relationship. [message #175366 is a reply to message #175192] Fri, 02 June 2006 00:14 Go to previous messageGo to next message
prase_pk
Messages: 40
Registered: July 2005
Location: india
Member
I have done it manually and by the way I am using forms4.5.

My insert and update statements are in the key commit trigger.
Everything is handled manually.Please help
Re: master-details relationship. [message #175372 is a reply to message #175366] Fri, 02 June 2006 00:42 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If you did it manually, then start again. Create the block A using the wizard, create B using the wizard, then create the 'relations' between A and B using the wizard.

In the B block define the key from the A block as a 'copy' of the A key field.

Then use the When-Create-Record trigger on block B to populate the extra B key field.

Search this forum for 'master detail' to see how other people have done it.

David

[Updated on: Thu, 07 September 2006 02:27]

Report message to a moderator

Re: master-details relationship. [message #175376 is a reply to message #175192] Fri, 02 June 2006 01:01 Go to previous messageGo to next message
prase_pk
Messages: 40
Registered: July 2005
Location: india
Member
Thanks david.
I understand what you have said.I have done that.
But I just need to know whether I can put commit after the user moves from the first record to the second record.If so which trigger should i use to handle th commit?
Re: master-details relationship. [message #175383 is a reply to message #175376] Fri, 02 June 2006 01:23 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Don't worry about it. Forms knows that you have changed block A so the user will get a message asking if they want to save their changes.

David
Re: master-details relationship. [message #175392 is a reply to message #175192] Fri, 02 June 2006 02:11 Go to previous messageGo to next message
prase_pk
Messages: 40
Registered: July 2005
Location: india
Member
you are right but can we handle it manually with our customization?
Re: master-details relationship. [message #175724 is a reply to message #175392] Mon, 05 June 2006 02:42 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The When-Button-Pressed is probably the best place to add a commit_form. Look at the WBP example in the reference manual.

David
Re: master-details relationship. [message #175742 is a reply to message #175192] Mon, 05 June 2006 03:43 Go to previous message
ingalesd
Messages: 10
Registered: June 2006
Location: Mumbai
Junior Member

if u have use relation between blocks in block a
use POST Built-in if u dont want to make changes permanent
while navigating between recrods
Previous Topic: Please give me idea how I highlight the gird row which have
Next Topic: VISSUAL ATTRIBUTE
Goto Forum:
  


Current Time: Fri Sep 20 08:25:41 CDT 2024