Learn how to use single Oracle Form's Alert object for warning/information messages and confirmation messages such as asking for delete confirmation etc. This task can be done using Set_Alert_Button_Property command.

Suppose you have created an alert with single button or with two button but for warning messages an alert should have single button and for confirmation messages an alert should have two buttons asking for "Yes/No" or "OK/Cancle", below is the example given to manage single alert for both type messages:

Create an Alert in 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 are setting alert_button2 (second alert button) property to null means it will 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 value:

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;

You can download this demo form from the following link dynalert.fmb

Screen shot of this form is below



Ask Your Questions By Comment Below.

Use single alert for warning messages and confirmation messages with set_alert_button_proerty, show_alert in Oracle forms

Post a Comment

More Topics

V. Kapoor

{picture#https://3.bp.blogspot.com/-q3wCssWUHo8/ViDFfCpPEuI/AAAAAAAAD0M/MHPvgnl3T3U/s1600/authpic.JPG} Vinish Kapoor is a Software Consultant, currently working in a reputed IT company in Noida, India and doing blogging on Oracle Forms, SQL and PLSQL topics. He is an author of an eBook Oracle Forms Recipes, which is available on Google play. {facebook#https://www.facebook.com/foxinfotech2014} {twitter#https://twitter.com/foxinfotech} {google#https://plus.google.com/u/0/+VKapoor/posts}
Fox Infotech. Powered by Blogger.