I can't seem to get APEX_ERROR.ADD_ERROR to work for interactive grid row processing. As an example, I created a simple editable interactive grid on a page on the EMP table. The EMPNO column is set as the primary key. I changed the default save interactive grid data process to a type of PL/SQL and supplied the code below. The processing simply throws an error for every row it tries to process. However, when the error message comes up in APEX, the row and cell are not marked as having an error and clicking the error link throws a JavaScript error. It seems that the value passed in the P_ROWNUM parameter (I pass in the EMPNO of the record, what should be the record ID), but it doesn't seem to make it through to the displayed error and associated link.
I realize that validations can be done before processing to show errors, but I have a client that uses an API for insert/update/delete that returns any errors and need to be able to display that. Since the API actually does the processing, its not a validation and I hesitate to put it there. I thought this would be simple to implement using APEX_ERROR.ADD_ERROR, but maybe I'm going about this wrong?
The APEX application demoing this can be found at https://apex.oracle.com/pls/apex/f?p=112290. Here you can try this out (just change any row and attempt to save) and you can also download a copy of the app from there as well.
Any suggestions or help is greatly appreciated!
Processing code:
DECLARE
l_region_id apex_application_page_regions.region_id%TYPE;
BEGIN
SELECT region_id
INTO l_region_id
FROM apex_application_page_regions
WHERE application_id = :APP_ID
AND page_id = :APP_PAGE_ID
AND region_name = 'EMP_IG';
APEX_ERROR.ADD_ERROR (
p_message => 'TEST: "' || :ENAME || '"',
p_additional_info => NULL,
p_display_location => apex_error.c_inline_with_field_and_notif,
p_region_id => l_region_id,
p_column_alias => 'ENAME',
p_row_num => :EMPNO
);
END;