In the oracle documentation on error handling, there is an example.
In the example code it states

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

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 ?
Cheers

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 ?

Gus C wrote:
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 ?

That depends on how you would regonize a page as having a manual tabular form.
Do the manual tabular forms have a template that only they use?
Do the page that have a manual tabular form belong to a specific page group? And this page group has only pages with manual tabular forms.

You could then build a select statement on the apex views to see if the current page has a manual tabular form.

Other ideas
* Use a apex item as flag that is set on page with a tabular form and cleared on pages with no tabular form.
* Record the page id's in a separate table.
* And as very very last resort hard code the page id's

Personally I would go with information that can be found in the apex views. And the leasts the developer has to think about setting it the better the solution.
But even setting a particular word in the comments of the region or page should work.

I don't have any page groups or special templates for manual tabular forms.
I tis also possible that pages without manual tabular forms have been set to display errors on the error page
Should I just do this

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;

Just found that the page also has a error handling function attribute.
From the help "If specified on page level the error handling function specified on application level will be overwritten. "

If you have/create a second function that sets l_result.display_location := apex_error.c_on_error_page instead of l_result.display_location := apex_error.c_inline_in_notification.
And use that function on the pages that have a tabular form.

Or as already mentioned in my previous post use a particular word or group of words in the comments of a page. You would than use something like.

I guess it depends how you want to figure out what is a manual tabular form page. I would hazard a guess you would use the process that the error is likely to occur from.

Since apex has more advanced tabular form processing now a days (no need to use the apex_application.g_f0x arrays), then you could define it as a page that has a process using apex_application.g_f0x array in the process. Although, this won't be a sure way so may not be relied upon (as described below)..

In saying that, it looks like t_error has an element of wwv_flow.t_component, which this post shows the attributes: {message:id=10571642}

- type
- id
- name

id seems to be the process id (At least when the type is: APEX_APPLICATION_PAGE_PROCESS). so:

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

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.

There is one downside however - wwv_flow.t_component is not documented, and I guess could be subject to change (i've added a feature request with the following key: AE36)