Friday 8 July 2011

OPEN_FORM vs. CALL_FORM vs. NEW_FORM

OPEN_FORM vs. CALL_FORM vs. NEW_FORM

A multiple-form application is designed to open more than one form module during a single Forms Runtime session. Every Form’s Runtime session begins the same way—with a single form module being loaded into memory. Once the first form module begins execution, it can programmatically invoke any number of additional form modules, which, in turn, can invoke still other forms.
When a form module programmatically invokes another, Oracle Forms looks for the new module in the appropriate directory and then loads it into memory.
Lets see the following three Built-ins to invoke one form from another.

OPEN_FORM Built-in

This built-in opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time.
Enter Query Mode: no
Syntax:
01PROCEDURE OPEN_FORM
02 
03(formmodule_name VARCHAR2,
04 
05activate_mode NUMBER,
06 
07session_mode NUMBER,
08 
09data_mode NUMBER,
10 
11paramlist_id PARAMLIST);
 Where:
formmodule_name:
  • The name of the form to open. Datatype is VARCHAR2. Required
activate_mode:
  • ACTIVATE: (The default.) 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 (The default.): Specifies that the opened form should share the same database session as the current form.
  • SESSION: Specifies that a new, separate database session should be created for the opened form.
data_mode
  • NO_SHARE_LIBRARY_DATA (The default.):At runtime, Oracle Forms will not share data between forms that have identical libraries attached (at design time).
  • SHARE_LIBRARY_DATA: At runtime, Oracle Forms will share data between forms that have identical libraries attached (at design time).
paramlist_id:
The unique ID that Oracle Forms assigns to the parameter list at the time it is created.

CALL_FORM Built-in:

Runs an indicated form while keeping the parent form active. Oracle Forms runs the called form with the same Runform preferences as the parent form. When the called form is exited Oracle Forms processing resumes in the calling form at the point from which you initiated the call to CALL_FORM.
Enter Query Mode: yes
Syntax:
01PROCEDURE CALL_FORM
02 
03(formmodule_name VARCHAR2,
04 
05display NUMBER,
06 
07switch_menu NUMBER,
08 
09query_mode NUMBER,
10 
11data_mode NUMBER,
12 
13paramlist_name VARCHAR2);
 Where:
formmodule_name: 
  • The name of the called form (must be enclosed in single quotes). Datatype is VARCHAR2.
display: 
  • HIDE (The default.): Oracle Forms will hide the calling form before drawing the called form.
  • NO_HIDE: Oracle Forms will display the called form without hiding the calling form.
switch_menu  
  • NO_REPLACE (The default.): Oracle Forms will keep the default menu module of the calling form active for the called form. 
  • DO_REPLACE: Oracle Forms will replace the default menu module of the calling form with the default menu module of the called form.
query_mode  
  • NO_QUERY_ONLY (The default.): Oracle Forms will run the indicated form in normal mode, allowing the end user to perform inserts, updates, and deletes from within the called form. 
  • QUERY_ONLY: Oracle Forms will run the indicated form in query-only mode, allowing the end user to query, but not to insert, update, or delete records.
data_mode  
  • NO_SHARE_LIBRARY_DATA (The default.): At runtime, Oracle Forms will not share data between forms that have identical libraries attached (at design time).
  • SHARE_LIBRARY_DATA: At runtime, Oracle Forms will share data between forms that have identical libraries attached (at design time).
paramlist_name  
  • The name you gave the parameter list object when you defined it. Datatype is VARCHAR2.

NEW_FORM Built-in

Exits the current form and enters the indicated form. The calling form is terminated as the parent form. If the calling form had been called by a higher form, Oracle Forms keeps the higher call active and treats it as a call to the new form. Oracle Forms releases memory (such as database cursors) that the terminated form was using. Oracle Forms runs the new form with the same Runform options as the parent form. If the parent form was a called form, Oracle Forms runs the new form with the same options as the parent form.
Enter Query Mode: no
Syntax:
01PROCEDURE NEW_FORM
02 
03(formmodule_name VARCHAR2,
04 
05rollback_mode NUMBER,
06 
07query_mode NUMBER,
08 
09data_mode NUMBER,
10 
11paramlist_name VARCHAR2);
Where:
formmodule_name  
  • Then name of the called form (must be enclosed in single quotes). Datatype is VARCHAR2.
 rollback_mode  
  • TO_SAVEPOINT (The default.): Oracle Forms will roll back all uncommitted changes (including posted changes) to the current form’s savepoint.
  • NO_ROLLBACK: Oracle Forms will exit the current form without rolling back to a savepoint.
  • FULL_ROLLBACK: Oracle Forms rolls back all uncommitted changes (including posted changes) that were made during the current Runform session.
query_mode 
  • NO_QUERY_ONLY (The default.) Runs the indicated form normally, allowing the end user to perform inserts, updates, and deletes in the form.
  • QUERY_ONLY Runs the indicated form in query-only mode; end users can query records, but cannot perform inserts, updates or deletes.
data_mode 
  • NO_SHARE_LIBRARY_DATA (The default.): At runtime, Oracle Forms will not share data between forms that have identical libraries attached (at design time).
  • SHARE_LIBRARY_DATA: At runtime, Oracle Forms will share data between forms that have identical libraries attached (at design time).
paramlist_name 
  • The name you gave the parameter list object when you defined it. Datatype is VARCHAR2.

No comments:

Post a Comment