Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 715
  • Last Modified:

FORM6i : Multi-form problem

Would be great if anyone could help me with this:
Say I have two forms A and B, A has a repeating timer
which, when fires, will GO_FORM to B and B's WHEN-WINDOW-
ACTIVATED should fire and do stuff. Problem is if
the focus is already on form B at the beginning,
form A's timer expires but form B's WHEN-WINDOW-
ACTIVATED trigger doesn't fire as it IS already the
active window of the two at the time of the timer
expiration. So the stuff in B's WHEN-WINDOW-ACTIVATED
won't execute when I want it to.

Any workaround? I need a solution to this urgently.
Thanks big time in advance!!
1 Solution
Helena Markováprogrammer-analystCommented:
It is an interesting question. Maybe the solution is putting code from When-Window-Activated trigger to the When-New-Form-Instance ?
hi jdnt,
      what u want to do is not logical actually.but even then, if the when-timr-expired fires in form 'a' and u go_form to form 'b' then the when-window-activated trigger in form 'b' fires and some staff is done but the problem is, after this is happened ,in the form 'a' the when-timer-expired trigger fires but in the form 'b' the when-window-activated trigger does not fire, is not it?
  actually when the focus is in form 'b' then again a when-window-activated will not fire,so what u have to do is ,u have to use the go_form builtin to move the focus again in
form 'a',in the code of when-window-activated
trigger ,after the code for the stuff u want to be done .
once ur when-window-activated trigger is fired for one form 'b' then in no way it will fire again if the focus is still in that form.so u have to have the focus moved to another form 'a' and again move to form 'b' then ur when'-window-activated will fire.follow the way:
1.suppose u created the timer in when-new-form-instance trigger of form 'a'-

tt timer;
note:u may use a button to initiate the timer as well.

2.in the when-timer-expired trigger of form 'a' place the code -

if not id_null(find_form('b'))then
end if;

note: here u just going to form 'b' that means form 'b'
 is already opend by any means.

3.in the when-window-activated trigger in form 'b' place the code -

ur stuff;
if not id_null(find_form('a'))then
end if;

4.u have to create one new trigger in form 'a' that is
when-form-navigate,the code will be -

     tt timer;
if id_null(find_timer('t1')) then
tt := create_timer('t1',2000,repeat);
end if;
end ;

 in this way u delete the timer in the expiration of the timer and again while coming to form 'a' u r creating the timer.this is because if u continue with the
timer which is created at first moment ,when u come back to form 'a' from form 'b' ,the when-timer-expired trigge does not work properly (i tested this method);
so when the focus is sent to form 'a' through the when-window-activated trigger of form 'b' ,the when-form-navigate trigger of form 'a'again create the timer ,so the when-timer-expired trigger in form 'a' will fire in due time.again the when-timer-expired trigger will send the focus to form 'b' and the when-window-activated triger of form 'b' will fire.
 here a point to be noted that wh-win-active is a trigger that fires at the very first moment when focus is sent a form.so if u go to the earlier form using go_form builtin from this trigger ,u dont have any chance to do any work in the form where wh-win-active fires.
  thats why at the very first line of this comment i told 'what u want to do is not logical'.

kdntAuthor Commented:
Not sure if I understand you totally, but thanks mehbub
for your lengthy response, I'll look for alternatives.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now