Alerts
Commercial applications will commonly encounter two types of error conditions. Those are system generated and those arise out of business rules being violated through the data being captured. Alternatively, the user of the commercial application must be informed of what occurred and if required be given information on how to correct the error condition. For instance, if the user has entered the cost price of a product as 0, then the system must show an error message as ‘Cost Price cannot be 0’.
Frequently choices are given on how to really process an event for example if the delete button is clicked the system must ask for a confirmation to delete the current record. If the user clicks on the ‘Yes’ or ‘OK’ button the record must be aborted.
Oracle Forms Builder permits creation of an object known an ‘Alert’ which makes displaying an error message and/or offering different processing choices quite easy and elegant.
An alert is a modal window that displays a message. An Alert is used to inform the user of unusual situations or to give a warning for an action that might have undesirable or unexpected consequences.
There are three styles of alerts: Caution, Stop and Note. Each style denotes a different level of message severity. The Message severity is represented visually through an icon that is displayed in an alert window.
Oracle Forms Builder uses many built-in alerts that display pre-defined messages. By a user Custom alerts created that can also be displayed in response to application-specific events.
When an event occurs that causes an alert to display, the alert must be responded for selecting one of its predefined Alert Buttons. For selecting any button instantly dismisses the alert and passes control back to the program that called it.
Whenever an alert is created, basic information such as the message to be displayed by the alert and the text labels for the alert buttons must be specified.
After creating an alert, an appropriate trigger or user-named routine must be written to display the alert in response to a particular event. Additionally, the action that each button initiates is determined by the PL/SQL code written in the trigger or user-named routine.
An Alert can be displayed by the SHOW_ALERT ( ) function. The SHOW_ALERT ( ) function returns alert_button 1 or alert_button2 or alert-button3 based on the button clicked through the user. That return value can be used to determine what action that has to be taken.