2
votes

I tried to add error message to an interactive grid after validation fails. I followed the documentation for apex_error.add_error procedure for tabular forms, but I could not get the error message to display inline with field in the interactive grid.

I tried the region id with the number format and varchar format, and column alias name with the column name in the db and name that is displayed on the browser. I am also thinking to display the message only in notification and add javascript to copy the notification somewhere, but I am not very sure how to do that. The html on the page looks like this:

<li class="a-Notification-item htmldbStdErr"> ::before "java.sql.SQLSyntaxErrorException: ORA-00904: "LEDGER1_NAME": invalid identifier for SEC_OBJ_CODE= erwq"
</li>

 APEX_ERROR.ADD_ERROR( p_message          => apex_json.get_varchar2('Message')||' for SEC_OBJ_CODE= ' ||:SEC_OBJ_CODE,
    p_display_location =>  apex_error.c_inline_with_field_and_notif,
    p_region_id   => '3104734890213506',
    p_column_alias => 'Sec Obj Val Sql',
    p_row_num  => :ROWID); 

The error I got is:

Ajax call returned server error ORA-20987: APEX - Error processing validation. - Contact your application administrator.

1
Not sure what the error here is about, but you could try entering debug mode and view the debug then. It shows a lot more information Also, I usually try all javascript code in the console, so you know what its actually doing.TineO

1 Answers

2
votes

To create a validation on a column of the interactive grid and display an error message associated with the column, do as follows:

  1. On page designer mode, search for you interactive grid region, expand the columns section and right click the column that you want to be validated and click create validation:

enter image description here

  1. Now you can build your validation using Type under "Validation" section;
  2. Under "Error" section, you can write your error message, set "display location" to "Inline with field" or "Inline with field and in notification" and "associated column" with the column you are validating (this will be filled already).