Home » Developer & Programmer » Forms » How to populate a different block after insert (Forms 6i)
How to populate a different block after insert [message #385675] Tue, 10 February 2009 08:53 Go to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Hello people!

I have two tables: A and B in master-detail relation. I created a form based on A and B. I created two canvases based on each data block. I move from canvas A to canvas B via button. I also have after insert trigger in DB, so when I create a new record in A, I make a copy of that record in B. It works fine. But the problem is this:

After I create a new record in canvas A, I immidiately move to canvas B via button, and I expect to see a copy of my record there, but I don't get data populated there. Do you have any advice for me, how to get this data? The only way now is to exit from that form (after inserting new record), and open it again.

Re: How to populate a different block after insert [message #385681 is a reply to message #385675] Tue, 10 February 2009 09:08 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
Does the button have any code to execute a query on the B block?
Re: How to populate a different block after insert [message #385687 is a reply to message #385681] Tue, 10 February 2009 10:10 Go to previous messageGo to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
No, it's WHEN-BUTTON-PRESSED trigger with GO_ITEM statement. A and B are in master-detail relation, so canvas B gets populated only when I exit and open the form again.

[Updated on: Tue, 10 February 2009 10:11]

Report message to a moderator

Re: How to populate a different block after insert [message #385691 is a reply to message #385675] Tue, 10 February 2009 10:26 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
The answer was in the question.
If you've got a db trigger that creates a record the only way the form is going to see it is to execute a query on the block in question.
Re: How to populate a different block after insert [message #385792 is a reply to message #385691] Wed, 11 February 2009 01:09 Go to previous messageGo to next message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
I already tried that. I put execute_query before go_item in WHEN-BUTTON-PRESSED, but the problem is, it gets some other record not the one I inserted.
Re: How to populate a different block after insert [message #385803 is a reply to message #385792] Wed, 11 February 2009 02:20 Go to previous message
sindikalac
Messages: 52
Registered: November 2008
Location: Europe
Member
Hey guys, I solved it:

In When-Button-Pressed I put Go_block, and in When-New-Block-Instance (block B) I put execute_query.

Thank you cookiemonster!
Previous Topic: please help
Next Topic: Signature capture
Goto Forum:
  


Current Time: Thu Dec 08 02:09:55 CST 2016

Total time taken to generate the page: 0.17672 seconds