20.6 ADD_ERROR Procedure Signature 4
This procedure adds an error message to the error stack that is used to display an error for a tabular form inline in a notification. 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 Oracle APEX 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_message          IN VARCHAR2,
    p_additional_info  IN VARCHAR2 DEFAULT NULL,
    p_display_location IN VARCHAR2,
    p_region_id        IN NUMBER,
    p_column_alias     IN VARCHAR2 DEFAULT NULL,
    p_row_num          IN NUMBER );Parameters
Table 20-4 ADD_ERROR Parameters
| Parameters | Description | 
|---|---|
| p_message | Displayed error message. | 
| p_additional_info | Additional error information needed if the error is displayed on the error page. | 
| p_display_location | Specifies where the error message is displayed. Use the constant apex_error.c_inline_with fieldorapex_error.c_inline_with_field_and_notif. See Constants and Attributes Used for Result Types. | 
| p_region_id | The ID of a tabular form region on the current page. The ID can be read from the view APEX_APPLICATION_PAGE_REGIONS. | 
| p_column_alias | Name of a tabular form column alias defined for p_region_id that is highlighted if apex_error.c_inline_with_fieldorapex_error.c_inline_with_field_and_notifare used as a display location. | 
| p_row_num | Number of the tabular form row where the error occurred. | 
Example
This example illustrates how to add a custom error message for a tabular form, where the column CUSTOMER_ID is highlighted, to the error stack. The error message is displayed inline in a notification. This example can be used in a validation or process.
                  
apex_error.add_error (
    p_message          => 'Invalid Customer ID!',
    p_display_location => apex_error.c_inline_with_field_and_notif,
    p_region_id        => l_region_id,
    p_column_alias     => 'CUSTOMER_ID',
    p_row_num          => l_row_num );Parent topic: APEX_ERROR