I have a report pages which have "edit" buttons which direct to the URL for the modify APEX page with the important information such as primary keys. If the data changes (i.e. a record was deleted) underneath the user and the user clicks "edit", the user gets the "ugly" message:
ORA-01403: no data found
<stop sign> Error Unable to fetch row.
OK
It occurs due to the before header process to fetch row. I could put additional regions to inform the user and conditions to show/execute the page differently. But I was hoping to do was to redirect the user back to the report page and have a notification message explaining the data changed and this is the current data.
I have a process before the fetch row process that checks if the data is there. If the data does not exist, then owa_util.redirect_url() redirects back to the report page. However, I have been unsuccessful in displaying a notification message. I've tried setting g_notification, g_print_success_message as well as putting the success info in the URL redirect. However, I have been unsuccessful in creating a notification. Below is the before header process:
declare
cnt PLS_INTEGER;
begin
select count(*) into cnt
from board
where board_id=:P220_BOARD_ID;
if cnt != 1 then
apex_application.g_notification :='Data Changed';
owa_util.redirect_url('f?p=&APP_ID.:200:&APP_SESSION.::NO:220:::&success_msg=changed data');
apex_application.g_unrecoverable_error:=true;
end if;
end;
Any thoughts would be greatly appreciated. Thank you.
-Carmine