Home » Developer & Programmer » Forms » alert cancel button gives non oracle exception (oracle forms, 10gr2, windows, ie8)
icon5.gif  alert cancel button gives non oracle exception [message #489968] Thu, 20 January 2011 06:38 Go to next message
ma04
Messages: 15
Registered: October 2009
Location: swindon, uk
Junior Member
hi gents

i've created an alert with 2 buttons and the code for cancel button is as follows:

...
if alert_id = alert_button2
then
raise form_trigger_failure;
end if;
...

this code is in a pll and when called from a form it displays a non oracle exception message.

any ideas how to do nothing when the user presses cancel on alert pop-up?

apart from using null instead of raising the above exception?

regards

MA
Re: alert cancel button gives non oracle exception [message #489971 is a reply to message #489968] Thu, 20 January 2011 07:02 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Why don't you work from the other way:
if show_alert(alert_id) = alert_button1 then
   <do something>
end if;


MHE

[Updated on: Thu, 20 January 2011 07:03]

Report message to a moderator

Re: alert cancel button gives non oracle exception [message #489972 is a reply to message #489968] Thu, 20 January 2011 07:03 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Is there a problem with using null? That is the standard way of denoting doing nothing.
Re: alert cancel button gives non oracle exception [message #489974 is a reply to message #489972] Thu, 20 January 2011 07:15 Go to previous messageGo to next message
ma04
Messages: 15
Registered: October 2009
Location: swindon, uk
Junior Member
the sequence of things is :

1. call to library procedure to display alert
2. some other calls to other bd procedures.

if user selects cancel then i don't want the form to anything and stop there hence raising forms_trigger_failure

what happens is that the later code in (2) is executed regardless of which button is pressed.

i only want do (2) if ok is pressed.

it's not feasible to change the library procedure to do something when alert_button1 is pressed.
Re: alert cancel button gives non oracle exception [message #489975 is a reply to message #489974] Thu, 20 January 2011 07:26 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Forms_trigger_failure causes an error by design. If you want to stop it you either need to catch it with an exception handler or not raise it in the first place.
Re: alert cancel button gives non oracle exception [message #489978 is a reply to message #489975] Thu, 20 January 2011 08:01 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
So, you've abandoned procedural programming and went for an extra exit point in your procedure? I still stand by my first answer: evaluate the alert return and if it is "alter_button1" then you perform the (2). Exactly like you want it to behave. But if you are reluctant to that approach, have you considered "return"? I'm not a huge fan of it but it does the trick, no?

MHE
Previous Topic: List item
Next Topic: FRM-41076 : Error Populating group (merged)
Goto Forum:
  


Current Time: Tue Sep 17 16:28:56 CDT 2024