Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validation in Interactive Grid, using apex_error

Kevin R PhillipsJul 17 2017 — edited Oct 16 2017

Hi all

I wonder if anyone can help me. I am trying to put some Validation into an Interactive Grid, raising the error message using apex_error.

I have seen the various overloads of apex_error; I think I need to try to work out which one to call.

What I am trying to do, is to do the same approach as I have used in a validation on a standard single record form page. Here I had a single PL/SQL validation procedure that checked *all* the items on the page, did the necessary validation, then called apex_error to put the messages out and associate the errors with the appropriate items. This worked a treat.

I wanted to try the same approach in an Interactive Grid i.e. a single PL/SQL procedure call that would then check the items and apex_error out as appropriate.

But I am getting

     Ajax call returned server error ORA-20987: APEX - JSON.WRITER.NOT_OPEN - User-Defined Exception for .

This is when I call

apex_error.add_error(p_message => 'Error message',

                       p_display_location => apex_error.c_inline_with_field_and_notif,

                       p_page_item_name => <column name>);

For example

IF :QUANTITY = 1 THEN

apex_error.add_error(p_message => 'Quantity must not be one',

                       p_display_location => apex_error.c_inline_with_field_and_notif,

                       p_page_item_name => 'QUANTITY');

return true;

end if;

where QUANTITY is one of the columns in the Grid.

Should I use one of the overloads of apex_item? Maybe:

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 );

Do I need to get the ID of the Region and somehow work out which Row Number I'm on? If so, does anyone have examples on how I do that?

Thanks

Kevin

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2017
Added on Jul 17 2017
2 comments
1,801 views