Solved

Open_Form Built-in

Posted on 2001-09-02
8
4,343 Views
Last Modified: 2007-11-27
I have developed a form which is based on a table and this form has a button which has a built-in open_form, which when pressed opens another form based on a view whcih takes the values from the first table and does some caculations and displays them in the second form through the When-Button-Pressed trigger.
     What I want is that whatever record I'm in Form 1 and when I go to the second form, the same record and its details should be displayed without running a query.
Do I need to write some additional trigger for this or am I missing some parameters of the Open_Form built-in?
0
Comment
Question by:hayub
8 Comments
 
LVL 2

Accepted Solution

by:
RMZ earned 50 total points
ID: 6448691
OPEN_FORM Built-In



Syntax
OPEN_FORM(form_name);

OPEN_FORM(form_name,activate_mode);
OPEN_FORM(form_name,activate_mode,session_mode);
OPEN_FORM(form_name,activate_mode,session_mode,
            paramlist_name);
OPEN_FORM(form_name,activate_mode,session_mode,
            paramlist_id);


Built-in Type:  restricted procedure (cannot be called in Enter Query mode)

Enter Query Mode:  no

Description:
Opens the indicated form. Call OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time.

Parameters:


no parameters     Opens the form and sets focus to it. Equivalent to Open_Form(ACTIVATE, NO_SESSION);



form_name          Specifies the CHAR name of the form to open.


activate_mode          ACTIVATE  Sets focus to the form to make it the active form in the application.


NO_ACTIVATE  Opens the form but does not set focus to the form. The current form remains current.



session_mode          NO_SESSION  Specifies that the opened form should  share the same database session as the current form. A COMMIT operation in any form will cause validation and commit processing to occur for all forms running in the same session.


SESSION  Specifies that a new, separate database session should be created for the opened form.



paramlist_name          Specifies the CHAR name of a parameter list to be passed to the opened form.


paramlist_id          Specifies the unique ID that Oracle Forms assigns to the parameter list at the time it is created. Use the GET_PARAMETER_LIST function to return the ID to a variable of type PARAMLIST.


Restrictions:

?     Oracle Forms Runform must be running with the Session option turned On when you execute OPEN_FORM with the session_mode parameter set to SESSION. If the Session option is Off, Oracle Forms issues an error and does not open the indicated form.



You can set session On for all Runform invocations by setting the FORMS45_SESSION environment variable to TRUE. When you set the FORMS45_SESSION variable, all Runform invocations inherit its setting, unless you override the environment variable by setting the Session option from the Runform command line.



Usage Notes:

?     Whether you open a form with ACTIVATE or NO_ACTIVATE specified, any startup triggers that would normally fire will execute in the opened form.



?     When you open a form with ACTIVATE specified (the default), the opened form receives focus immediately; trigger statements that follow the call to OPEN_FORM never execute.



?     When you open a form with NO_ACTIVATE specified, trigger statements that follow the call to OPEN_FORM will execute after the opened form has been loaded into memory and its initial start-up triggers have fired.



?     On Microsoft Windows, if any window in the form that opens the independent form is maximized, the first window displayed by the opened form will also be maximized, regardless of its original design-time setting. (The GUI display state of a window is controlled by the Window_State property.)



?     For most applications, you should avoid using OPEN_FORM with forms that contain root windows. Because there can be only one root window displayed at a time, canvas-views that are assigned to the root window in the current form and in the opened form will be displayed in the same window. This causes the opened form to "take over" the root window from the original form, thus hiding the canvas-views in the original form partially or completely.

___________________
See also
Invoking Independent Forms with OPEN_FORM
SESSION option
Opening Forms in Different Databae Sessions

Copyright (c) 1994, Oracle Corporation.
----RMZ---
0
 
LVL 2

Expert Comment

by:RMZ
ID: 6448699
HI
the best solution is in the form having button put this code in when-button-pressed
:global.ttt:='';
begin
  :global.ttt := :datablock.field1;
  open_form(formname);
end;
----newform
in master datablock
chane where to
fld =:global.ttt
---
when-new-form-instancle
execute_query;
-----rmz----
0
 
LVL 2

Expert Comment

by:santoshmathew
ID: 6448705
Hi,

In order to see the same record in the second form you have to pass the primary key of the block in the second form. To do this you can use global variables or parameters.
For eg: in the When-Button-Pressed trigger of the first form before the open form you can write:

:global.primary_key_field:=:Primary_Key_field.

After this call the second form. In the second form you can write the following in the when-new-form-Instance
trigger :

Set_block_property(Block_name,default_where,'primary_key_field=:global.primary_key_field');

Execute_Query;

Now reset the where clause of the block if you want using :

Set_block_property(Block_name,default_where,'');

Regards.
0
 

Author Comment

by:hayub
ID: 6448884
I have tried the above two options but stll no luck yet!!
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 2

Expert Comment

by:RMZ
ID: 6449843
HI
can u tell me the primary key in first datablock if first form and the relation between 2 datablock in secound form
---rmz---
0
 

Expert Comment

by:vhin_s
ID: 6451988
Hi,

   In your MODULE1 add this code in when-botton-pressed trigger

DECLARE
  pl_id        PARAMLIST;
  theformname  VARCHAR2(20);
  pl_name VARCHAR2(10) := 'tempdata';
 
BEGIN
  theformname := 'MODULE2';
  pl_id := GET_PARAMETER_LIST('tempdata');
  IF ID_NULL(pl_id) THEN  
     pl_id := Create_Parameter_List(pl_name);            
  END IF;
  Add_Parameter(pl_id,'DNS',TEXT_PARAMETER,  :BLOCK_NAME.item_name );                    
  CALL_FORM(theformname,hide,no_replace,no_query_only,pl_id);                
  Delete_Parameter('tempdata','DNS');
END;

Remarks  :
   In MODULE1, I create a parameter programmatically and name it as DNS and pass the value of  :BLOCK_NAME.item_name to MODULE2 .


   Do this in your MODULE2 ,
      1.  You should create a PARAMETER in the Object Navigator and name it as 'DNS'
      2.  In the data block of MODULE2 set the where clause  to  < DATA_BLOCK . item_name  = :PARAMETER . dns >

Remarks ;
      The parameter I passed  from MODULE1 will received by the PARAMETER  I created at the object navigator in MODULE2 and use it as a where clause in the data block.


Hope this solves the problem

Vhin


 
0
 

Expert Comment

by:vhin_s
ID: 6452000
by the way , for you not to run a query you should add the built-in procedure  EXECUTE_QUERY into the when -new-form-instance trigger of your MODULE2.


0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6837072
ADMINISTRATION WILL BE CONTACTING YOU.  THIS IS BEING POSTED IN ALL YOUR OPEN QUESTIONS TODAY.

This question appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, you must tell the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below, include the question QID/link.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process:  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11756459.html
http://www.experts-exchange.com/questions/Q.11966818.html
http://www.experts-exchange.com/questions/Q.20002985.html
http://www.experts-exchange.com/questions/Q.20080116.html
http://www.experts-exchange.com/questions/Q.20117054.html
http://www.experts-exchange.com/questions/Q.20136568.html
http://www.experts-exchange.com/questions/Q.20141808.html
http://www.experts-exchange.com/questions/Q.20170683.html
http://www.experts-exchange.com/questions/Q.20177412.html
http://www.experts-exchange.com/questions/Q.20192197.html
http://www.experts-exchange.com/questions/Q.20211088.html
http://www.experts-exchange.com/questions/Q.20244652.html
http://www.experts-exchange.com/questions/Q.20245681.html
http://www.experts-exchange.com/questions/Q.20250442.html
http://www.experts-exchange.com/questions/Q.20259920.html
http://www.experts-exchange.com/questions/Q.20263344.html
http://www.experts-exchange.com/questions/Q.20272565.html
LOCKED AWAITING ACCEPTANCE
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20254380
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20170530
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20156898
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20073456
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=20015528


PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:
 
Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange


P.S.  For year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to recover a database from a user managed backup

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now