Link to home
Start Free TrialLog in
Avatar of Venkat052498
Venkat052498

asked on

How to exit form?

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.
Avatar of sganta
sganta

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
Hi

You go to Default Menu

Field/Clear
Record/Clear
Block/Clear

Then EXIT_FORM
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.
Avatar of Venkat052498

ASKER

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.


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.

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.

ASKER CERTIFIED SOLUTION
Avatar of poncejua
poncejua

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dear Poncejua,
                      Thank you, for your exhaustive analysis.By setting mouse navigate property to false,the problem was solved.

With Regards
 Venkat.
Is that not what I suggested in my first answer?

 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.