2. Objectives
• Default Messaging
• Identify Different Types of Messaging in Form Builder
• Create and control Alerts
http://ebiztechnics.blogspot.com
3. Displaying Messages to Operators
Messages
Application
Working
Informative
Error
Alerts
System
Application
http://ebiztechnics.blogspot.com
4. Errors and Built-ins
• Built-in failure does not cause an exception.
• Test built-in success with FORM_SUCCESS function.
• What went wrong?
– ERROR_CODE, ERROR_TEXT, ERROR_TYPE
– MESSAGE _CODE, MESSAGE _TEXT, MESSAGE _TYPE
Example: GO_BLOCK(‘EMP’);
IF FORM_SUCCESS THEN
EXECUTE_QUERY;
END IF;
FORM_FAILURE
FORM_FATAL
Returns TRUE OR
FALSE.
http://ebiztechnics.blogspot.com
9. Displaying Errors to an Alert
Changing the Alert Button Label:
SET_ALERT_BUTTON_PROPERTY(‘Err_Alert’,
ALERT_BUTTON1,
LABEL,’O.K’);
SET_ALERT_PROPERTY(’Err_Alert’,
ALERT_MESSAGE_TEXT, ERROR_TYPE||
’-’||TO_CHAR(ERROR_CODE)||
’: ’||ERROR_TEXT);
n := SHOW_ALERT(’Err_Alert’);
http://ebiztechnics.blogspot.com
10. Summary
• Displaying Messages in Form Builder
• Built-ins
– ERROR_CODE, ERROR_TYPE, ERROR_TEXT
– MESSAGE_CODE, MESSAGE_TYPE, MESSAGE_TEXT.
• Testing Built-ins with FORM_SUCCESS
• Alerts
• Setting alert Properties at runtime.
http://ebiztechnics.blogspot.com
Hinweis der Redaktion
Example of On-Error trigger
IF ERROR_CODE=40202 THEN
MESSAGE(‘You must fill in the field for and employee’);
ELSE
MESSAGE(ERROR_TYPE||’-’||TO_CHAR(ERROR_CODE)||’:’||ERROR_TEXT);
END IF;
RAISE FORM_TRIGGER_FAILURE;
Example of On-Message trigger
IF MESSAGE_CODE=40350 THEN
MESSAGE(‘No records found for search values’);
ELSE
MESSAGE(MESSAGE_TYPE||’-’||TO_CHAR(MESSAGE_CODE)||’:’||MESSAGE_TEXT);
END IF;