?
Solved

return to form that is already open

Posted on 2001-08-21
11
Medium Priority
?
1,828 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

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

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup
Suggested Courses

764 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