Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

return to form that is already open

Posted on 2001-08-21
11
Medium Priority
?
1,853 Views
Last Modified: 2010-08-05
If a form is already open I want to return to this form not open the same form again. Below is how I tried to do this but it does not work.

IF ID_NULL(FIND_FORM('FORM1')) THEN
   OPEN_FORM('FORM1');
ELSE
   GO_FORM('FORM1');
END IF;
0
Comment
Question by:maryeb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 4

Accepted Solution

by:
jtrifts earned 400 total points
ID: 6409320
It depends on how you've navigated to the form you're in, in the first place.  Consider that there are three ways to invoke a form:
OPEN_FORM
CALL_FORM
NEW_FORM.

If you have got to FORM2 by invoking a call_form('FORM2'), then you are effectively creating a call stack.  I.E.
FORM1--> FORM2--> FORM3-->...FORMnn.

Implemented this way, a close_form for the current form (or indeed an exit_form) will send you back to the next form on the stack.  Then you don't have to specify what form you want to return to at all.

One of the things that this highlights is that design is important.  The flow of work and the way users are intended to proceed through the forms is important.

The call_form for example, though it will create a handy call stack, will also disable the other forms until the current form is dismissed, returning you to the previous form on the stack.

NEW_FORM will let you replace one form with another, while OPEN_FORM let's you open one after the other again ad again, often letting you open multiple instances of the same form.
another thing to think about is whther or not the work done in the next form is necessarily part of the same transaction.  If not, you do have the option of opening forms in different sessions (and hence different transactions)...but I digress...

SO back to your specific question:

the use of go_form is correct, however I suspect you are referencing the FMX name rather than the form name...

GO_FORM(form_name);  Here FORM_NAME is the name of the target form.  The data type of name is VARCHAR2. NOTE: The GO_FORM built-in attempts to search for the form module name, not the name of the .fmx file. (Check in the object navigator to see if the form label (which defaults to MODULE1 for newly created forms) is the same as the name you are passing...

JT
0
 

Author Comment

by:maryeb
ID: 6409961
Yes, I had GO_FORM(form name of the .fmx file);
It works fine with GO_FORM(module name);

BUT,

I have a search form, where the user enters a pid and data is displayed on this form relating to that pid. Then the user clicks the button More, if they want to see further information about this pid. This brings the user to another form that displays further information.

Now if the user returns back to the search screen and enters a different pid I want the user to be able to see further information on this pid if they wish, but I can't do this as with the code below I am asking it to go to the form if it is already open. If I remove this code (GO_FORM('FORM2');) and the user enters the same pid into the search form for the second time a new form will be opened displaying information relating to this pid. Therefore two forms will be opened with the exact same data, I want it to go to the form if the pid is the same.

IF ID_NULL(FIND_FORM('FORM2')) THEN
 OPEN_FORM('FORM2');
ELSE
 GO_FORM('FORM2');
END IF;

Is there another way around this problem.

0
 
LVL 4

Expert Comment

by:jtrifts
ID: 6410002
OK.  Let me see if I have this straight.

Form1 = search form.
Form2 = results form.

Run Form 1. Enter query detail (PID). Press Search Button.
IF FORM2 already open with same PID, go to the FORM2.
IF FORM2 NOT OPEN or FORM 2 is open but PID is different, open a new instance of FORM2.

Is this what your requirements are?

IF so, I'll post a follow-up...
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Author Comment

by:maryeb
ID: 6410082
Yes
0
 

Author Comment

by:maryeb
ID: 6421561
JT,

The above comment is what I am looking for........any update.
0
 
LVL 4

Expert Comment

by:jtrifts
ID: 6421825
Sorry Mary...have been busy...I'm not certain...

And you haven't yet told me why you're so keen on keeping this as a two form approach...especially when most think that this might be an inappropriate design...

I'll try to ge tback to you when I can, but am swamped with other things at the mo...

Regards,

JT
0
 

Author Comment

by:maryeb
ID: 6421931
I now have

Form1 where I enter my search criteria(PID), then my search data relating to this criteria is displayed on the same form(Form1).

In Form1 I may have a number of records displayed. So now to see even more information relating to the PID entered I have a button called MORE which opens a new form(Form2) with additional information.

This is why I still need a solution to the above.
0
 
LVL 4

Expert Comment

by:jtrifts
ID: 6421948
This could still be done within the same form either on another canvas, or within another window...
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7042751
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
LVL 4

Expert Comment

by:jtrifts
ID: 7047011
either points to jtrifts or delete the question.
JT
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7058164
Thanks, JT, points clearly to you. :)
Moondancer - EE Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question