Home » Developer & Programmer » Forms » alerts (forms 10g)
alerts [message #458113] Thu, 27 May 2010 07:35 Go to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
I have written code on WHEN-BUTTON-PRESSED trigger

if any one closing form i asking YOU WANT TO CLOSE THE SEARCH BOX
if yes then close the form else written to search box....

alert is generating but if i click on yes it not get closed....


DECLARE
al_id Alert;
al_button NUMBER;
BEGIN
al_id := Find_Alert('CLOSE_ALERT');
SET_ALERT_PROPERTY(al_id, TITLE, 'SEARCH BOX CLOSE!!!!');
SET_ALERT_PROPERTY(al_id, ALERT_MESSAGE_TEXT, 'YOU WANT TO CLOSE THE SEARCH BOX?');
al_button := Show_Alert(al_id);
IF al_button = 'YES' THEN
EXIT_FORM('SEARCH_BLOCK');

ELSE
GO_BLOCK('SEARCH_BLOCK');
END IF;
EXECUTE_QUERY;
END;


whats problem in this code?
Re: alerts [message #458119 is a reply to message #458113] Thu, 27 May 2010 08:09 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
lokeshsurana wrote on Thu, 27 May 2010 08:35

al_button NUMBER;

IF al_button = 'YES' THEN

whats problem in this code?


I'd start with those 2 conflicting lines.
Re: alerts [message #458215 is a reply to message #458119] Fri, 28 May 2010 00:11 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
why all of this!!


you can put this code in the trigger when button pressed:
DECLARE
a number;
begin
a := show_alert('EXIT_ALERT');
if a=alert_button1 then
exit_form;
else go_item('book.ISBN'); //we assum book.isbn the first field in my form
end if;
end;



after this u have to create alter in you data block,then go to it's proprety palete and change it's name 'EXIT_ALERT' and there is a proprety message :write in it what u want ...
Re: alerts [message #459024 is a reply to message #458215] Thu, 03 June 2010 01:00 Go to previous messageGo to next message
yeahia
Messages: 22
Registered: June 2010
Location: Bangladesh
Junior Member

Your al_button type is number, but you compare it by character. i think you should change it;
Re: alerts [message #463777 is a reply to message #459024] Sat, 03 July 2010 06:22 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sorry that I have been so long in replying. Have you solved your problem?

Go to the examples in the Reference Guide and you will find that you have to use "IF al_button = ALERT_BUTTON2 THEN".

David
Previous Topic: calling reports from forms
Next Topic: system.message_level
Goto Forum:
  


Current Time: Fri Sep 20 03:59:25 CDT 2024