14.5 ADD_ERROR Procedure Signature 3
This procedure adds an error message to the error stack that is used to display text as defined by a shared component. This error message can be displayed to all display locations. It can be called in a validation or process to add one or more errors to the error stack.
Note:
This procedure must be called before the Application Express application has performed the last validation or process. Otherwise, the error is ignored if it does not have a display location of apex_error.c_on_error_page
.
Syntax
APEX_ERROR.ADD_ERROR (
p_error_code IN VARCHAR2,
p0 IN VARCHAR2 DEFAULT NULL,
p1 IN VARCHAR2 DEFAULT NULL,
p2 IN VARCHAR2 DEFAULT NULL,
p3 IN VARCHAR2 DEFAULT NULL,
p4 IN VARCHAR2 DEFAULT NULL,
p5 IN VARCHAR2 DEFAULT NULL,
p6 IN VARCHAR2 DEFAULT NULL,
p7 IN VARCHAR2 DEFAULT NULL,
p8 IN VARCHAR2 DEFAULT NULL,
p9 IN VARCHAR2 DEFAULT NULL,
p_escape_placeholders IN BOOLEAN DEFAULT TRUE,
p_additional_info IN VARCHAR2 DEFAULT NULL,
p_display_location IN VARCHAR2,
p_page_item_name IN VARCHAR2 );
Parameters
Table 14-3 ADD_ERROR Procedure Signature 3 Parameters
Parameters | Description |
---|---|
|
Name of shared component text message. |
|
Additional error information needed if the error is displayed on the error page. |
|
Values for %0 through %9 placeholders defined in the text message. |
|
If set to |
|
Specifies where the error message is displayed. Use the constants defined for |
|
Name of the page item on the current page that is highlighted if |
Example
This example illustrates how to add a custom error message, where the text is stored in a text message, to the error stack. The P5_CUSTOMER_ID item is highlighted on the page. The error message is displayed inline in a notification. This example can be used in a validation or process.
apex_error.add_error (
p_error_code => 'INVALID_CUSTOMER_ID',
p0 => l_customer_id,
p_display_location => apex_error.c_inline_with_field_and_notif,
p_page_item_name => 'P5_CUSTOMER_ID' );
Parent topic: APEX_ERROR