Home » Developer & Programmer » Forms » Alert while deleting the record.
Alert while deleting the record. [message #580096] Wed, 20 March 2013 06:51 Go to next message
Anand Mallarapu
Messages: 12
Registered: March 2013
Location: India
Junior Member
Hi,

I want to create one alert while deleting the record from the custom form. So i have written the below code in the when-remove-record trigger.

DECLARE
alert_button NUMBER;
BEGIN
IF :XXWIPRELFRM.PRINTED = 'Yes' THEN
alert_button := SHOW_ALERT ('DELETE_ALERT');
IF alert_button = alert_button1 Then
delete_record();
commit_form();
ELSIF alert_button = alert_button2 Then
RAISE Form_Trigger_Failure;
END IF;
END IF;
END;

When i click on the delete(X) symbol in the form, it is showing alert but when i click on "No" also its removing the record. Please suggest me what i need to write.

Thanks,
Andy
Re: Alert while deleting the record. [message #580098 is a reply to message #580096] Wed, 20 March 2013 07:23 Go to previous messageGo to next message
cookiemonster
Messages: 10902
Registered: September 2008
Location: Rainy Manchester
Senior Member
TRy moving the code to KEY-DELREC
Re: Alert while deleting the record. [message #580099 is a reply to message #580098] Wed, 20 March 2013 07:38 Go to previous messageGo to next message
Anand Mallarapu
Messages: 12
Registered: March 2013
Location: India
Junior Member
Thanks a lot it is working.

I have one more question in one custom form we have one editable field so users will enter a text there and some times forgot to save. And clicking on the one button but i wanted display one alert like 'Do you want to save changes?' when they click on that button. How to do that.
Re: Alert while deleting the record. [message #580100 is a reply to message #580099] Wed, 20 March 2013 07:40 Go to previous messageGo to next message
Littlefoot
Messages: 19468
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create an alert which will pop-up when user presses the button.
Re: Alert while deleting the record. [message #580104 is a reply to message #580100] Wed, 20 March 2013 07:54 Go to previous messageGo to next message
Anand Mallarapu
Messages: 12
Registered: March 2013
Location: India
Junior Member
Yes i will create a alert and i will call that alert in the button as well.
But my question is how to identify user was not saved entered text.
Re: Alert while deleting the record. [message #580105 is a reply to message #580104] Wed, 20 March 2013 07:59 Go to previous messageGo to next message
Littlefoot
Messages: 19468
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Basically, you don't have to do anything. If user tries to leave the form (normally, if NO_VALIDATE was not used), Forms will raise its own alert.
Re: Alert while deleting the record. [message #580106 is a reply to message #580105] Wed, 20 March 2013 08:01 Go to previous messageGo to next message
cookiemonster
Messages: 10902
Registered: September 2008
Location: Rainy Manchester
Senior Member
Or if the user does anything to wipe the modified data - clear block, enter query etc - forms will also raise the alert.
Re: Alert while deleting the record. [message #580113 is a reply to message #580106] Wed, 20 March 2013 08:32 Go to previous message
Anand Mallarapu
Messages: 12
Registered: March 2013
Location: India
Junior Member
Yes i agree with that. But here when user enters a text and did not saved, clicked on button it not showing alerts and it is continuing with another work. So when user clicked a button i wanted to check when is there any unsaved data in the form then i will raise an alert for confirmation.

Thanks a lot for your answers and patience as well.
Previous Topic: RTF changes not shown for specific language
Next Topic: Killing inactive form session through oracle application server
Goto Forum:
  


Current Time: Wed Aug 20 09:52:51 CDT 2014

Total time taken to generate the page: 0.16068 seconds