What do I need to add to my code to set the error to dispaly on the error page, if the page is a manual tabular form ?
-- Always show the error as inline error -- Note: If you have created manual tabular forms (using the package -- apex_item/htmldb_item in the SQL statement) you should still -- use "On error page" on that pages to avoid loosing entered data l_result.display_location := case when l_result.display_location = apex_error.c_on_error_page then apex_error.c_inline_in_notification else l_result.display_location end;
Gus C wrote:That depends on how you would regonize a page as having a manual tabular form.
Yes, the code will always change the error page in inline.
My question is how do I code it, so that all manual tabular forms stay on the error page and do not change to inline.
How can I determine whether the current page is a manual tabular for or not ?
or is there a better way.
if v('app_page_id') in (2,3,4,5,6) -- these are pages with manaul tabular forms then l_result.display_location := apex_error.c_on_error_page else l_result.display_location := apex_error.c_inline_in_notification end if;
Or use a code in the name of the page.
select pag.page_id from apex_application_pages pag where pag.page_id = :app_page_id and pag.application_id = :app_id and pag.page_comment like '%manual tabular form%'
Of course, there are lots of situations where you may be using the apex_application.g_f0x array that is not directly related to a manual tabular form (e.g. tabular form, hidden items on an sql report, etc). But I feel this is probably one of the better ways to check for a manual tabular form process. Also, with the available data in p_error, you could probably rule out other types - standard tabular form has a value in p_error.region_id whereas a manual tabular form will not.
if p_error.component.type = 'APEX_APPLICATION_PAGE_PROCESS' then select upper(PROCESS_SOURCE) into l_source from apex_application_page_proc where process_id = p_error.component.id; if instr(l_source, 'APEX_APPLICATION.G_F0') > 0 then --we are referencing the array in the process that generated the error. There is a fairly good chance it is a manual tabular form page --SET error type to manual tabular form type end if; end if; --SET error type for everything else