Home » Developer & Programmer » Forms » forms
forms [message #628394] Mon, 24 November 2014 15:09 Go to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo
how can i create a forms,that performs: when i click the (X) icon, or when i want to exit it or close it, it should not display any alert message. (Like, Do you want to save any changes ? or Do you want to exit this forms? etc.)
can anyone give me a suggestion please Smile
thank you
Re: forms [message #628401 is a reply to message #628394] Mon, 24 November 2014 15:25 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
EXIT_FORM(NO_VALIDATE);
Re: forms [message #628402 is a reply to message #628394] Mon, 24 November 2014 15:30 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
My first question would be why wouldn't you want to warn of un-saved changes when your user tries to close your application?

The trigger associated with the [X] in the top right corner of the window is When-Window-Closed. If you truly want your application to exit with no warning, etc., write your trigger with:
BEGIN
  -- Check if the form is in QUERY mode
  IF ( :SYSTEM.MODE != 'NORMAL' ) THEN
    Exit_Form(NO_VALIDATE);
  END IF;

  Exit_Form(NO_VALIDATE);
END;

I do not think it is a good idea to do this, however. What if the user thought they had saved their changes, but really didn't? This code will cause the user's changes to be lost.

Craig...
Re: forms [message #628403 is a reply to message #628402] Mon, 24 November 2014 15:38 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hi.. thankx for the prompt reply Smile
@Craig, yes, your suggestion is very useful and true, but i mean to say is, if i want to just exit from the current forms without entering any input or changing any data, then it should not show any alert message. Smile
Re: forms [message #628421 is a reply to message #628403] Tue, 25 November 2014 03:16 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you exit form without changing anything then you wont get a message anyway. If you think you haven't changed anything and are getting a message anyway then that'll be because there is code in the form making changes. In which case the solution is to find that code and fix, not mask the problem with exit_form(no_validate).
Re: forms [message #628429 is a reply to message #628421] Tue, 25 November 2014 04:04 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo cookiemonster
thankx for your Suggestion Smile where can i find this code what you have mentioned actually? Smile
or can you please make me agian clear, what actually you mean ? Smile
regards,

Re: forms [message #628437 is a reply to message #628429] Tue, 25 November 2014 04:43 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
It can be any code that changes a datablock item and it can be in almost any trigger (other than ones that only fire when you have already modified data - the validate triggers and pre-insert/update/delete). If you're struggling to work out which bit of code is the culprit then you will probably need to add messages to the triggers that display :system.block_status or :system.form_status and see at what point the status becomes CHANGED.

Re: forms [message #628450 is a reply to message #628437] Tue, 25 November 2014 06:51 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
hi
thankx all for your valualbe Suggestion.now i am trying to supress another alert message,
how can i avoid alert message when i try to Close current window with ctl+q keyword?
thankx Smile
Re: forms [message #628452 is a reply to message #628450] Tue, 25 November 2014 07:00 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
What alert message are you trying to suppress?
Because generally speaking you shouldn't try to suppress alert messages, they're there for a reason. If necessary you should be avoiding getting into the situation that causes the alert in the first place.
Re: forms [message #628453 is a reply to message #628452] Tue, 25 November 2014 07:04 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
hi Smile
yes, ist true not to do so but, actually i am trying to just avoid this alert message, when i just want to Close the current form without giving any Input.

it works when i click (X) button at right side but, when i press ctrl+q shortcut key then it displays,

"Do You want to Close this form?" Yes, NO button

this message i want to avoid Smile
can you please help me?
thanking you
Re: forms [message #628467 is a reply to message #628453] Tue, 25 November 2014 08:56 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Cookiemonster is correct, masking the message is not the proper way. Typically, the Post-Query trigger is where people put code that changes the Form status because it queries in additional information about a record. This is the first place to look. After that, it is a simple case of tracing through your Form to find where there is code that sets the value of a field. This means you have to look at each trigger in your form to find where you have code that is setting the value of a Block Item. Your fix could be as simple as changing a Block Item to a Display Item but could be as complicated as re-writing a portion of your code to ensure the values being retrieved through code do not change the status of an item. Only YOU can figure this part out. Smile

Craig...
Re: forms [message #628542 is a reply to message #628467] Wed, 26 November 2014 03:10 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo
I have created a Trigger to Exit the forms window when i press F4, but it did not work.
Can anyone help me please?
I have written this in Form Level
thankx

BEGIN
  IF ( :SYSTEM.MODE != 'NORMAL' ) THEN
    Exit_Form(NO_VALIDATE);
  END IF;
  Exit_Form(NO_VALIDATE);
END;
Re: forms [message #628629 is a reply to message #628542] Wed, 26 November 2014 08:30 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
"did not work" is not a valid Oracle error message. Where is this trigger? What is this trigger? Just creating a user named trigger will do nothing unless you call it.

[Updated on: Wed, 26 November 2014 08:30]

Report message to a moderator

Previous Topic: Trigger to clear then set focus
Next Topic: Login window Error
Goto Forum:
  


Current Time: Fri Apr 19 21:55:04 CDT 2024