Writing On-Error Trigger In Oracle Forms

Suppose you want to handle an error in oracle forms and want to display custom error message for that error, but also you want to customize more for a particular error. For example there are many fields in form with required property is set to TRUE for Not Null check.

The example below shows the error handling in oracle forms with a specific Frm-40202 error.

On-Error Trigger
Trigger Level - Form

Declare
   error_item varchar2(50);
   curr_item_label varchar2(100);
Begin
   error_item := :system.trigger_item;
   if error_type = ‘FRM‘ and error_code = 40202 then
      curr_item_label := get_item_property(error_item, prompt_text);
     --- you can use alert also to show the message 
      message(curr_item_label || ‘ cannot be left blank.‘);
   else
      message(error_text);
      --- visual attribute a_errors must exists or create your own 
      set_item_property(error_item, current_record_attribute, ‘A_errors‘);
   end if; 
end;

Like us to get notifications for free source code in future, thanks.

时间: 2024-10-25 22:47:42

Writing On-Error Trigger In Oracle Forms的相关文章

An Example of On-Error Trigger in Oracle Forms

I wrote this trigger around 4 years ago to handle errors in an application based on Oracle Forms 6i. This trigger handles all errors with some custom messages for some specific errors and not only this after giving an appropriate message to the user

Learn How To Create Trigger In Oracle Forms

I have written many posts related to triggers in Oracle Forms, I have given examples for Form Level triggers, Data Block Level triggers and Item Level Triggers. And in this tutorial I am just giving the simple tutorial to how to create a trigger in O

Define Custom Data Filter Using Pre-Query Trigger In Oracle Forms

Oracle Forms is having its default records filter, which we can use through Enter Query mode to specify some search criteria or to filter records before display, but you can also create your own filter, which can be more user friendly and easy to use

Using Post_Query Trigger in Oracle Forms

When a query is open in the block, the Post-Query trigger fires each time Form Builder fetches a record into a block. The trigger fires once for each record placed on the block's list of records. Usage NotesUse a Post-Query trigger to perform the fol

How to Log Users Login and Logout Details Through Oracle Forms

Log user's login and logout details in to table through Oracle Forms using POST-LOGON and PRE-LOGOUT triggers to track the user's login and logout activity for auditing purposes. In this example one table and a sequence object is used to log the data

Writing Text File From A Tabular Block In Oracle Forms

The example given below for writing text file or CSV using Text_IO package from a tabular block in Oracle Forms. Suppose there is a tabular grid data block "Job_History" in your forms and you want to write a CSV on click of a button by reading w

Pre-Update and Pre-Insert Trigger Examples For Oracle Forms

See also: Why And When To Use Pre-Update and Pre-Insert Triggers In Oracle Forms Pre-Update Fires during the Post and CommitTransactions process, before a row is updated in Oracle Forms. It fires once for each record that is marked for update. The fo

Pre-Query trigger in Oracle D2k / Oracle Forms

Pre-Query trigger in Oracle D2k / Oracle Forms DescriptionFires during Execute Query or Count Query processing, just before Form Builder constructs and issuesthe SELECT statement to identify rows that match the query criteria.Definition Level form or

How To Use DBLink In Oracle Forms 6i

You want to connect multiple databases in oracle forms to perform certain tasks, for example you need to execute ddl or dml statements against databases but when you try to use dblink it gives you error or suddenly quits from the oracle forms. Soluti