Solved

How to exit form?

Posted on 1998-05-31
10
5,048 Views
Last Modified: 2008-02-01
How  to exit a form  at runtime, when the input focus is in a required text_item? I am getting an error message
 FRM-40202  "Field must be entered" ,when I tried to use exit_ form built in.
0
Comment
Question by:Venkat052498
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 4

Expert Comment

by:sganta
ID: 1081714
Hai Venkat !

I have 2 solutions for your answer. If you are trying to EXIT the form without VALIDATING
the records (i.e without committing). Am I Right ! Fine.

Then use this COMMAND in your code
Solution 1

EXIT_FORM(NO_VALIDATE);

(Or)

Solution 2 :

CLEAR_FORM(NO_VALIDATE);
EXIT_FORM;

I hope this is acceptable to you, If you have any problems, you are always welcome
to me.
             Thanks & Regards - sganta
0
 
LVL 4

Expert Comment

by:sganta
ID: 1081715
Hi

You go to Default Menu

Field/Clear
Record/Clear
Block/Clear

Then EXIT_FORM
0
 
LVL 3

Expert Comment

by:vlad_impala
ID: 1081716
In the key-exit trigger at form level...
if exit_form(no_validate) does not work you could always re-set :system.message_level to 20.  This message is at level 15 and would be suppressed.

If your exit procredure is on a button you should also set mouse navigate to false on the button properties so that focus does not try to move to the button (and out of your mandatory field) when it is pressed.

If you reject this answer please add a comment to explain why - it usually helps to clarify the problem.

vlad.
0
 

Author Comment

by:Venkat052498
ID: 1081717
Thank you for taking pain.I tried your solutions.The message was suppressed,but i am
not out of form.To make you clear,i am elaborating the problem.I have called a form through NEW_FORM built in with NO_QUERY_ONLY argument.The first interface item is text item with no base table.Due to some reason immediately after form start up i tried to exit the form through EXIT_FORM(no_validate) built in when the infut focus is in required field.  But i failed to exit. Try to solve my problem.


0
 
LVL 3

Expert Comment

by:vlad_impala
ID: 1081718
Without seeing the code it is hard to tell exactly what is happening.
A possible solution is that when you call EXIT_FORM you are in Enter Query mode (try checking with "IF :System.Form_Status = 'QUERY' ") in this case EXIT_FORM will cancel the query not exit the form (but in this case I would not expect the FRM-40202 message).  
Another possibility is that the form is in a CALL_INPUT function, EXIT_FORM would terminate the CALL_INPUT function.

In either case you would need to call EXIT_FORM twice to exit the form - try it to see what happens.

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 3

Expert Comment

by:vlad_impala
ID: 1081719
I assume the last answer did not help, as far as I am aware exit_form should work unless one the the two conditions I mentioned are present.  With the limited description supplied I have no more suggestions - I would need to see the actual code to spot what is/is not happening.

What kind of trigger are you using?
Perhaps you could post the exact text of the trigger.

0
 
LVL 3

Accepted Solution

by:
poncejua earned 50 total points
ID: 1081720
================================================
 
CASE 1.
=======

FRM-40202 can occur if you are using button items in a block that also contains required fields or fields with validation.
 
To avoid FRM-40202 when clicking on a button, set the 'Mouse Navigate' item property to FALSE for the button.  The default is TRUE.
 
For example:
------------
You have a block on dept that contains the required field dept.deptno, and a button with a When-Button-Pressed trigger.  
 
When you press the button, You receive FRM-40202 "Item must be entered" when the button is pressed.  
 
Set the 'Mouse Navigate' property to FALSE, and the required field validation will not be fired when the button is pressed.
 
 
Solution Explanation:
==================
 
When 'Mouse Navigate' is FALSE, Oracle Forms does not perform navigation to the button when it is pressed.  When 'Mouse Navigate' is TRUE, Oracle Forms navigates to the item and fires navigation and validation triggers which cause
the FRM-40202 to occur.  You do not have to navigate to the button for the When-Button-Pressed trigger to fire.

==================================================

CASE 2.
=======
 
You may receive FRM-40202 as intended using radio buttons and radio groups with required fields, but the radio button you are clicking on does not get selected in a consistent manner.  
 
This behavior is Oracle Forms bug 336430.  Bug 336430 has been reported on Oracle Forms 4.5.6.5.5, and also reproduces in Developer/2000 Release 1.3 32-bit Oracle Forms 4.5.7.0.10.  This bug is still an open issue with Development.
 
For example:
 
o You have a radio group as the first item in the block, with 2 radio buttons.  The first radio button is the default.
 
o The second item in the block is a required text item.  For example, emp.ename
 
o Run the form
 
o Click in radio button 1 ( the default ), then click in ename and leave it blank
 
o If you click on the default radio button after leaving the ename required field blank, you will receive FRM-40202 as expected, but the default button will be selected.
 
 If you click on radio button 2 ( not the default ) after leaving the ename required field blank, you will receive FRM-40202 as expected, but radio button 2 will NOT be selected.
   
Workaround for Bug 336430:
---------------------------------------------
 
Set the 'Mouse Navigate' item property FALSE for the radio group.  This will allow either button to be selected without moving focus off of the required text item.  Thus, FRM-40202 will not occur.
 
If you must leave the 'Mouse Navigate' property TRUE for the radio group, then you could make the required field text item not required, but then you have to validate this yourself.
 
 
Solution Explanation:
=====================
 
The behavior of the radio button that is selected after receiving FRM-40202 is not the same depending on whether the radio button selected is the default. This inconsistency is reported in Oracle Forms bug 336430.
 
==================================================

CASE 3.
=======
 
You may receive FRM-40202 when trying to go into ENTER-QUERY mode.  This is Oracle Forms bug 324949.
 
Bug 324949 occurs going into ENTER-QUERY mode when the first item in the  block has a format mask and item is required.   This bug has been fixed in Oracle Forms 4.5.7 and above.
 
For example:
------------
 
 1.  Create a form with a block based on the scott/tiger emp table
 2.  The first field in the form should be empno
 3.  Add a format mask to the empno field of 9999
 4.  Run the form
 5.  Enter a number in the empno field  
 6.  Use the backspace key to delete the value in the empno field
 7.  Select Query->Enter to from the default Runform menu to enter a query.  
     You will get FRM-40202 as expected.
 8.  Select Record->Clear from the default Runform menu
 9.  Select Query->Enter to from the default Runform menu to enter another query.  Again, you get FRM-40202.  
10.  This prevents you from entering a query, executing a query, clearing the block, removing the record, etc.
 
Workaround for Bug 324949:
----------------------------------------------
This bug does not reproduce when the first item in the block is required, but does not have a format mask.  Thus, remove the format mask from the first item.
 
Solution Explanation:
=====================
 
Bug 324949 is causing FRM-40202 to occur incorrectly if the first item contains a format mask.  Upgrade to Oracle Forms 4.5.7 or above to resolve this bug.
 
=================================================

CASE 4.
=======
 
Oracle Forms bug 273420 causes FRM-40202 to occur when trying to call another form using OPEN_FORM when a required field is empty on the current form.  This bug affects Oracle Forms 4.5.5.X and 4.5.6.X, and is reported fixed in 4.5.7.X.  
 
Workaround for Bug 273420:
----------------------------------------------
To avoid this error, set the validation_unit form property to form_scope before using OPEN_FORM.
 
For example:
 
/** In whatever trigger you are using to open the form **/
 
BEGIN
     SET_FORM_PROPERTY( 'formname', VALIDATION_UNIT, FORM_SCOPE );
     OPEN_FORM('formname');  
END;
 
/** Create a When-Window-Activated trigger in the calling form.  This   **/
/** will set the validation unit back to item_scope when returning from **/
/** the other form.                                                     **/
 
BEGIN
     IF GET_FORM_PROPERTY( 'formname', VALIDATION_UNIT ) = 'FORM_SCOPE'
        THEN SET_FORM_PROPERTY( 'formname', VALIDATION_UNIT, ITEM_SCOPE );
     END IF;
END;
 
Solution Explanation:
=====================
 
OPEN_FORM should not attempt to validate the current form before opening the second form.  Setting the validation unit will work around this error by specifying the scope of validation to be at the form level, instead of the item level ( the default ).

==================================================
 
CASE 5.
=======
 
You may receive FRM-40202 when you attempt to cancel changes in a record that contains a required field.
 
To cancel changes made in a record without having to enter values in the required fields:
 
1.  Use the Record->Clear Menu Option:
    ----------------------------------
    The form operator can use the Record->Clear menu option from the default Oracle Forms Runform menu.
 
 
2.  Use the CLEAR_RECORD built-in:
    ------------------------------
    You can programmatically call the CLEAR_RECORD Oracle Forms built-in.
 
    For example:
 
    You could have a button labelled 'Cancel', and the following
    When-Button-Pressed trigger:
 
    BEGIN
        CLEAR_RECORD;
    END;
 
 
    NOTE:
 
    Make sure the 'Mouse Navigate' item property for the button is FALSE.  Otherwise required field validation will not allow navigation out of a required field when trying to press the 'Cancel' button, if data has not been entered.
 
Solution Explanation:
================

CLEAR_RECORD causes Oracle Forms to remove, or flush, the current record from the block without performing validation.

==================================================

CASE 6.
=======
 
FRM-40202 may occur navigating to another block after using a
When-New-Record-Instance trigger to programmatically assign default values to the block you are navigating from.
 
To avoid FRM-40202 in this situation, use the When-Create-Record trigger to assign the default values instead of the When-New-Record trigger.
 
 
Solution Explanation:
=================
 
After the When-New-Record-Instance trigger fires, the SYSTEM.RECORD_STATUS is changed to INSERT.  After the When-Create-Record trigger fires, the SYSTEM.RECORD_STATUS remains NEW, and the user will be able to navigate to another block.
 
The When-Create-Record trigger only populates a record with the equivalent of default values, and does not attempt to alter the record status, and until the operator changes the record, the status will remain NEW.
 
Note:
 
Bug 308106 is causing Oracle Forms 4.5.6 to not correctly report the status of the record as NEW.  The SYSTEM.RECORD_STATUS should reflect NEW after the
When-Create-Record trigger fires, and is reflecting INSERT status.  This bug is reported as fixed in Oracle Forms 4.5.7.X.
 
==================================================
 
Additional Information:
==================
 
Oracle Forms 4.X Reference Manual Volume 1,
Chapter 2, Triggers
           When-Create-Record Trigger
           When-New-Record-Instance Trigger
Chapter 4, System Variables
           SYSTEM.RECORD_STATUS  

==================================================
I hope this helps you.

Best regards,

Juan Manuel Ponce Martinez
DBA - Buenos Aires - Argentina
0
 

Author Comment

by:Venkat052498
ID: 1081721
Dear Poncejua,
                      Thank you, for your exhaustive analysis.By setting mouse navigate property to false,the problem was solved.

With Regards
 Venkat.
0
 
LVL 3

Expert Comment

by:vlad_impala
ID: 1081722
Is that not what I suggested in my first answer?

0
 

Author Comment

by:Venkat052498
ID: 1081723
 Dear vlad impala,
                           Yes,you are right.But some reason,when i tried it did not worked for me.I remember your answer,but i already rejected your answer.Sorry.
 Thank you .


 With Regards
 Venkat.
 
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

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

707 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

19 Experts available now in Live!

Get 1:1 Help Now