Home » Developer & Programmer » Forms » when-window-activated (Oracle Design Editor 10.1.2.0.2)
when-window-activated [message #648195] Thu, 18 February 2016 07:26 Go to next message
aguilo_fl
Messages: 4
Registered: February 2016
Location: Palma, spain
Junior Member
Good morning,

Here is my issue:
Form A (master-detail)calls Form B passing a selected row. Forms B calls a PL/SQL DD.BB. package that creates a dublicate of the record selected from FORM A, modifying the name and creating a new pk. The duplicate pkg functions correctly. I created a global variable that holds the value of the PK that I just created.

WHEN-BUTTON-PRESSED in Form B calls the package that creates the new rows and exits finding the focus back to Form A.
In Form A, I have a WHEN-WINDOW-ACTIVATED event where I would like to visualize the row that I have just inserted.
Here is what I have in that trigger:

BEGIN
if :GLOBAL.GRUPCOA is not null then
Go_block('GRUQST');
clear_block(no_validate);
:GRUQST.COA := :GLOBAL.GRUPCOA;
execute_query('no_validate');

end if;

END;

This gives me a FRM-1086 error. "It was never stablished a recording point for F_1.." (This message was translated so is probably not accurate)
I have tried many other ways of executing the query giving the value held in the global value without any success. I have tested successfully the value in it.

EXPECTED RESULT: I would like to display the record with the primary key that I am passing.

Please help.
Joan Pere

[Updated on: Fri, 19 February 2016 01:21]

Report message to a moderator

Re: when-window-activated [message #648230 is a reply to message #648195] Fri, 19 February 2016 01:22 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

Form A (master-detail)calls Form B ...

Suppose that it is done by pressing a button. Its WHEN-BUTTON-PRESSED trigger would contain something like
call_form('form_B');

Do whatever you do in form B. When it terminates, the focus is back in the form A, with "processing" set to the very first line that comes after the CALL_FORM.

Therefore, move code from WHEN-WINDOW-ACTIVATED to WHEN-BUTTON-PRESSED so that it looks like
call_form('form_B');

-- when I'm back from form B:
if :global.grupcoa is not null then
   set_block_property('block_name', onetime_where, 'coa = ' || :global.grupcoa);
   go_block('gruqst');
   execute_query;
end if;


Any improvement?
Re: when-window-activated [message #648235 is a reply to message #648230] Fri, 19 February 2016 01:49 Go to previous messageGo to next message
aguilo_fl
Messages: 4
Registered: February 2016
Location: Palma, spain
Junior Member
Thanks Little foot.
Should the second part of your code be placed in the WWA in Form A?

if :global.grupcoa is not null then
set_block_property('block_name', onetime_where, 'coa = ' || :global.grupcoa);
go_block('gruqst');
execute_query;
end if;
Re: when-window-activated [message #648240 is a reply to message #648235] Fri, 19 February 2016 02:47 Go to previous messageGo to next message
aguilo_fl
Messages: 4
Registered: February 2016
Location: Palma, spain
Junior Member
Added the call_form in the WBP trigger and the second part of the code in the WWA trigger:
<if :global.grupcoa is not null then
set_block_property('block_name', onetime_where, 'coa = ' || :global.grupcoa);
go_block('gruqst');
execute_query;
end if;>
THe result is that I open a second instance of Form A but it doesn´t execute the query.

[Updated on: Fri, 19 February 2016 02:49]

Report message to a moderator

Re: when-window-activated [message #648243 is a reply to message #648240] Fri, 19 February 2016 03:03 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I wouldn't use WHEN-WINDOW-ACTIVATED at all and put the whole
call_form('form_B');

-- when I'm back from form B:
if :global.grupcoa is not null then
   set_block_property('block_name', onetime_where, 'coa = ' || :global.grupcoa);
   go_block('gruqst');
   execute_query;
end if;

into the WHEN-BUTTON-PRESSED in form A (which calls the form B).
Re: when-window-activated [message #648245 is a reply to message #648243] Fri, 19 February 2016 03:37 Go to previous messageGo to next message
aguilo_fl
Messages: 4
Registered: February 2016
Location: Palma, spain
Junior Member
Littlefoot,
These are two different moduls, not windows inside one module. I am not sure the set_block_property of a different module its gonna work.
Re: when-window-activated [message #648356 is a reply to message #648245] Mon, 22 February 2016 03:04 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You seem to be missing the point. All this code needs to go in a WBP trigger in form A. That's the form that contains the block that needs to be re-queried after the new record is added, so you're setting properties of a block in the same form as the trigger.
Re: when-window-activated [message #648365 is a reply to message #648356] Mon, 22 February 2016 05:43 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
LF

put the whole <code> into the WHEN-BUTTON-PRESSED in form A

vs.
CM

this code needs to go in a WBP trigger in form A


/forum/fa/3314/0/
Re: when-window-activated [message #648366 is a reply to message #648365] Mon, 22 February 2016 05:46 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
I do realize I'm repeating what you said, but from OPs last post he seems to have misunderstood that point.
Previous Topic: rdutils.pll library is not opening up in forms builder
Next Topic: deploying a .fmb form
Goto Forum:
  


Current Time: Thu Mar 28 13:45:12 CDT 2024