Home » Developer & Programmer » Forms » Have one block update another (11g)
Have one block update another [message #653661] Wed, 13 July 2016 11:06 Go to next message
Melancolie
Messages: 2
Registered: July 2016
Junior Member
I am new to forms, and i've tried googling/searching for this issue without luck, so hope you'll be patient if my question is stupid.

I have block ID_NUMBERS that gets populated through when-new-form-instance. This block holds a list of identification numbers that has issues and need to be handled manually.

These id's can come from a variety of sources, so i have 3 other blocks; INFO, RELATIONS and RELATIONS_MANUAL. Not all id's will be populating all 3 blocks.

I've made a stored procedure FETCH_INFO that populates the blocks based on the type of id. This works perfectly.

I would very much like the user to be able to browse through the ID's in the ID_NUMBERS block and have the FETCH_INFO procedure executed everytime a new ID is selected.

I simply cant get this to work since i have a number of GO_BLOCK inside FETCH_INFO.

Is this at all possible, or do i need a button SHOW_INFORMATION that users will have to manually click?
Re: Have one block update another [message #653692 is a reply to message #653661] Thu, 14 July 2016 14:19 Go to previous messageGo to next message
Littlefoot
Messages: 21612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not sure I understood everything you said, but here's what I think; see if it helps.

Quote:

I would very much like the user to be able to browse through the ID's in the ID_NUMBERS block ...

As block already contains IDs, you can scroll up and down - no problem with that, I presume. However, did you mean to say that you want to *refresh* contents of that block (and fetch some new IDs)? If that's so, create a (form) procedure and move code that populates ID_NUMBERS block from WHEN-NEW-FORM-INSTANCE (WNFI) trigger into that procedure. Then invoke the procedure when necessary - from WNFI trigger; additionally, create a button (I believe you call it SHOW_INFORMATION) in the ID_NUMBERS block and do the same in the WHEN-BUTTON-PRESSED trigger so that user could refresh the block manually. Or, you could even try to do the same "automatically" using a timer (it is described in Forms Help; have a look).

Quote:

... and have the FETCH_INFO procedure executed everytime a new ID is selected.

Would WHEN-NEW-RECORD-INSTANCE help here? Put call to the FETCH_INFO in there and see what happens.
Re: Have one block update another [message #653693 is a reply to message #653692] Thu, 14 July 2016 14:26 Go to previous messageGo to next message
Melancolie
Messages: 2
Registered: July 2016
Junior Member
Littlefoot wrote on Thu, 14 July 2016 14:19
I'm not sure I understood everything you said, but here's what I think; see if it helps.

Quote:

... and have the FETCH_INFO procedure executed everytime a new ID is selected.

Would WHEN-NEW-RECORD-INSTANCE help here? Put call to the FETCH_INFO in there and see what happens.


I think this trigger might do the trick, it seems to be able to do GO_BLOCK at least. And it's one of the few i havent tried (since i'm new to forms i dont think it's very easy to guess what all the triggers do based on their name).

I solved it through double-click, but this might be more elegant. Thanks for the help! Smile
Re: Have one block update another [message #653706 is a reply to message #653693] Fri, 15 July 2016 03:04 Go to previous message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
WNRI will do the job, you just have to careful to avoid an infinite navigation loop.
If it runs a procedure that goes to other blocks then back to the block the trigger is on (cause you want the cursor end back where it started) that'll cause WNRI to fire again. You can avoid the second fire from doing anything by setting and checking a global variable.
Previous Topic: Generating Sequence with conditions
Next Topic: forms not running
Goto Forum:
  


Current Time: Fri Oct 23 22:22:01 CDT 2020