oracle forms: messages

10
Form Builder Messages and Alerts http:// ebiztechnics.blogspot.com

Upload: sekhar-byna

Post on 10-Feb-2017

492 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Oracle Forms: Messages

Form Builder Messages and Alerts

http://ebiztechnics.blogspot.com

Page 2: Oracle Forms: Messages

Objectives

• Default Messaging• Identify Different Types of Messaging in Form Builder• Create and control Alerts

http://ebiztechnics.blogspot.com

Page 3: Oracle Forms: Messages

Displaying Messages to Operators

MessagesApplicationWorkingInformativeError

AlertsSystemApplication

http://ebiztechnics.blogspot.com

Page 4: Oracle Forms: Messages

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

Page 5: Oracle Forms: Messages

Message Severity Level

>25

20

15

10

5

0

25

All (default)

More critical

Define by:

:SYSTEM.MESSAGE_LEVEL

Fatal Error

http://ebiztechnics.blogspot.com

Page 6: Oracle Forms: Messages

Error Triggers

• On-Error Trigger– Fires when system error message is issued. Built-ins to Use:– Use ERROR_TYPE– ERROR_CODE– ERROR_TEXT

• On-Message Trigger– Fires when informative message is issued. Built-ins to Use:– MESSAGE_TYPE– MESSAGE_CODE– MESSAGE_TEXT

http://ebiztechnics.blogspot.com

Page 7: Oracle Forms: Messages

Alerts Properties

Title

ALLERT_BUTTON1 ALLERT_BUTTON3ALLERT_BUTTON2

Alert Message Text (Max 200 Characters)

Alert Style

http://ebiztechnics.blogspot.com

Page 8: Oracle Forms: Messages

Showing Alerts

DECLARE n Number;BEGIN n:=SHOW_ALERT(‘Del_Alert’);

IF n = ALERT_BUTTON1 THENDELETE_RECORD;

END IF;END;ORIF SHOW_ALERT('DEL_ALERT‘) = ALERT_BUTTON1 THEN

DELETE_RECORD;END IF;

NOTE: SHOW_ALERT Function Returns Number.

http://ebiztechnics.blogspot.com

Page 9: Oracle Forms: Messages

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

Page 10: Oracle Forms: Messages

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