In Oracle Forms, Alerts are used to give a message to the user at runtime. We can create three types of Alerts in Oracle Forms. These three types are information message, a warning or error, and a confirmation message. In this tutorial, you will learn how to create Alerts in Oracle Forms.
Create Alert to Give Information or Warning Message with Single Button
Follow these steps.
- In Oracle Form's Object Navigator, click on the Alerts node and then click on the + icon to create a new Alert.
- Then do the right click on it and select Property Palette option.
- The Property Palette window will open. There change the following properties to create an Information or warning message alert.
- Name: INFO_ALERT
- Title: Information
- Message: You logged in Successfully.
- Alert Style: Select Note (if information message), select Stop (if error message) or Caution for the warning message.
- Button Label 1: OK (leave button label 2 and 3 will be blank because this is just a message alert, so we need single button only).
- Default Alert Button: Button 1
Then close the Property Palette window. Now your information message alert has been created. You can use it as shown in the example below.
Declare n number; Begin n := show_alert('info_alert'); end;
You can also set the alert message property at runtime, with set_alert_property command. Below is an example.
Declare n number; Begin set_alert_property('info_alert', alert_message_text, 'Your password will expire in 3 days.'); n := show_alert('info_alert'); end;
Create Alert to Ask For a Confirmation From The User with Yes/No Button
Follow these steps.
- In Oracle Form's Object Navigator, click on the Alerts node and then click on the + icon to create a new Alert.
- Then do the right click on it and select Property Palette option.
- The Property Palette window will open. There change the following properties to create a confirmation message alert.
- Name: ASK_ALERT (give any name)
- Title: Confirm?
- Message: Are you sure to delete the record(s)?
- Alert Style: Caution
- Button Label 1: Yes
- Button Label 2: No
- Default Alert Button: Button 2 (which is set to No)
Confirmation Alert created. Close the Property Palette window and use it as shown in the example below.
Declare n number; Begin n := show_alert('ask_alert'); if n = alert_button1 then -- if user selected yes Delete_record; end if; end;
thanks a lot, it was very usesfully 🙂
Hi,
what is the meaning of cross mark on any property instead of green?is it means that that particular property is not working?
Hi....Any way to display a query output in the alert? I just want to know how to display data from a table (say 10-20 rows) in an alert