You can display modal windows in Oracle Forms to display normal messages, Error message or asking for confirmation eg. On deleting a record or saving a record etc. using Show_alert command. These modal window messages can be shown using Alert option in Oracle forms. The shot below for this example:you can download this form from the following LINK:MODAL_MSGT.FMB for This example I has created three alerts with the following names:1. Good_msg 2. Error_msg 3. Ask_alert The following code is written for "Show good Message" button to display a normal Message, you can use this cod E in any plsql block:declare--Create a numeric variable to hold Show_alert return valueNalertbutton number; Begin--Set the message for alertSet_alert_property (' good_msg ', Alert_message_text, ' Records saved successfully. ');--After below statement the execution would hold till you click on OK. Becuase it is an modal windowNalertbutton: = Show_alert (' good_msg ');: alertblock.result: = ' That is a good message. ';--After this can perform any task ... End; The following code is written for ' Show Error Message ' button to display an error message:declare
--Create a numeric variable to hold Show_alert return value
Nalertbutton number;
Begin
--Set the message for alert
Set_alert_property (' error_msg ', Alert_message_text, ' An error occurred. ');
--After below statement the execution would hold till you click on OK. Becuase it is an modal window
Nalertbutton: = Show_alert (' error_msg ');
: alertblock.result: = ' That is an ERROR message. ';
--After this can perform any task ...
End;
The following code is written for ' Ask confirmation ' button to ask for a confirmation:declare
--Create a numeric variable to hold Show_alert return value
Nalertbutton number;
Begin
--Set the message for alert
Set_alert_property (' Ask_alert ', Alert_message_text, ' Confirm Yes or No ');
--After below statement the execution would hold till you click on OK. Becuase it is an modal window
Nalertbutton: = Show_alert (' Ask_alert ');
--now check which button or answer has been choosen
If Nalertbutton = Alert_button1 Then
: Alertblock.result: = ' you choose Yes. ';
Else
: Alertblock.result: = ' you choose No. ';
End If;
--After this can perform any task ...
End; Subscribe to Get e-mail notifications for Latest Updates like this:
See also http://www.foxinfotech.in/2015/02/using-single-alert-for-messages-and-confirmation-messages.html
Displaying Modal Window Messages in Oracle Forms Using Show_alert