Sharing an Oracle Form Htoolbar.fmb for Oracle Forms 10g/11g containing Horizontal Toolbar canvas and a control block with basic navigational and operational buttons, which can be customized easily as per your form's requirement. 

Just change the data block name in most Go_block statements. You can add extra functionality according to your form and icons.

Below is the screen shot for this toolbar, download this Oracle Forms 11g  FMB (it will not open in Forms 6i) with the following link Htoolbar.fmb Ver 10g/11g:

Copy and paste control data block and all canvases into your form and when form asks for subclass or copy choose copy or you can create an object library of this form to use in other forms.

Post-Form trigger in Oracle Forms fires during the Leave the Form process, when a form is exited. 

You can use Post-Form trigger for the tasks such as: To clean up the form before exiting. For example, use a Post-Form trigger to erase any global variables that the form no longer requires. To display a message to the operator upon form exit etc.

This trigger does not fire when the form is exited abnormally, for example, if validation fails in the form and on failure processing halts.

Create the post-form trigger as shown in below screen shot:

Below is the example given for post-form trigger to ask the user on exit of the form that "Are you sure to Exit?" if user choose yes (alert_button1) then exit and if user choose No (alert_button2) then cancel the exiting of form.

if show_alert('conf_alert') = alert_button1 then
 -- do nothing or perform any task on exiting such as log some data etc.    
          -- and form will exit.
raise form_trigger_failure;
        -- this will cancel the forms exit execution.
end if;

Pre-Form trigger in Oracle Forms fires during the form start-up, before forms navigates to the first navigable data block of that form. 

Use a Pre-Form trigger to perform the tasks such as maximize the forms_mdi_window, initialize some Global variables or set some properties of the form or data blocks etc. and if form gets failed to load (On Failure) Oracle Forms leaves the current form and fires no other trigger. 

The following is an example of Pre-Form trigger:

Create the pre-form trigger as shown in below screen shot:

And write the following code in code editor to maximize the parent form window (forms_mdi_window) of Oracle Forms

SET_WINDOW_PROPERTY(forms_mdi_window, window_state, maximize);

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:

n number;
set_alert_button_property('alert', alert_button2, label, '');
set_alert_property('alert', alert_message_text, 'Message Alert!');
n := show_alert('alert');

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:

n number;
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!';
          :buttonsel := 'You choose NO!';
end if;

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

Screen shot of this form is below

V. Kapoor

{picture#} 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#} {twitter#} {google#}
Fox Infotech. Powered by Blogger.