Writing On-Error Trigger In Oracle Forms
2016-12-25 21:12
781 查看
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;
[align=center][/align]Like us to get notifications for free source code in future, thanks.
[align=left][/align]
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;
[align=center][/align]Like us to get notifications for free source code in future, thanks.
[align=left][/align]
相关文章推荐
- An Example of On-Error Trigger in Oracle Forms
- Learn How To Create Trigger In Oracle Forms
- Using Pre-Form Trigger In Oracle Forms
- Trigger Execution Sequence in Oracle Forms
- Using Post-Form Trigger In Oracle Forms
- Define Custom Data Filter Using Pre-Query Trigger In Oracle Forms
- Examples For When-Validate-Item trigger In Oracle Forms
- Trigger Execution Sequence in Oracle Forms
- Using Post_Query Trigger in Oracle Forms
- Triggers in Oracle Forms
- Oracle Invalid character ' ' in value part of property error
- oracle 移动表空间报 Error:ORA-01033:ORACLE initialization or shutdown in progress
- DML Error Logging in Oracle 10g Database Release 2
- ERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger
- TNS:no listener error in Oracle XE after changing computer name
- APP-FND-01564: Oracle error 1403 in fdxwho
- 【Oracle问题集4】ORA-00205 error in identifying controlfile
- adpatch报错:An error occurred while generating Oracle Forms files.
- (V45) Trigger Execution Sequence in Forms 4.5
- Exception String: Error in invoking target ‘agent nmo nmb’ of makefile CentOS 64位安装Oracle 10g 报错