Learn how to use a single Oracle Form's Alert object for Warning/information messages and confirmation messages such as Aski ng for delete confirmation etc. This task can is done using the Set_alert_button_property command.
Suppose you has created an alert with a single button or with a button but for warning messages an alert should has sing Le button and for confirmation messages an alert should has a buttons asking for "yes/no" or "ok/cancle", Below is the Example given to manage single alert for both type messages:
Create an Alert on Oracle Forms Object Navigator and write the following code for giving simple or warning messages:
Declare
n number;
Begin
set_alert_button_property (' Alert ', Alert_button2, label, ');
set_alert_property (' Alert ', Alert_message_text, ' message alert! ');
N: = Show_alert (' alert ');
End
In the above example we is setting Alert_button2 (second Alert button) property to null means it would not show the second button in Alert window.
Following is the example to use same alert for asking for confirmation by setting Second Alert button property to some Val Ue:
Declare
n number;
Begin
set_alert_button_property (' Alert ', Alert_button1, label, ' Yes ');
set_alert_button_property (' Alert ', Alert_button2, label, ' No ');
set_alert_property (' Alert ', Alert_message_text, ' Do you know Oracle? ');
N: = Show_alert (' alert ');
If n = Alert_button1 Then
: Buttonsel: = ' you choose yes! ';
Else
: Buttonsel: = ' you choose no! ';
End If;
End
Can download this demo form from the following link DYNALERT.FMB
Screen shot of this form is below
See also: http://www.foxinfotech.in/2013/03/findalert-showalert-oracle-forms.html
Using single Alert for Messages and confirmation Messages in Oracle Forms with Set_alert_button_property