In a modal page I have a button that triggers a DA, inside the DA I execute PL / SQL code and in a certain place depending on the value of a variable obtained I execute the following code to show an error:
apex_error.add_error ( p_message => 'ANY ERROR',
p_display_location => apex_error.c_inline_in_notification);
This statement is executed with errors, in the debug and shows a call stack, is it a bug?
What other alternative do I have to show an error from PL / SQL? I am using apex 20
0.59400 | 0.00000 |
- display_location: INLINE_IN_NOTIFICATION |
4 | 0% |
0.59400 | 0.00000 |
- is_internal_error: false |
4 | 0% |
0.59400 | 0.00100 |
- is_common_runtime_error: false |
4 | 0% |
0.59500 | 0.00000 |
- error_backtrace: ----- PL/SQL Call Stack ----- object line object handle number name 00007FFC1A883A18 1039 package body APEX_200100.WWV_FLOW_ERROR.INTERNAL_GET_ERROR 00007FFC1A883A18 1107 package body APEX_200100.WWV_FLOW_ERROR.INTERNAL_ADD_ERROR 00007FFC1A883A18 1160 package body APEX_200100.WWV_FLOW_ERROR.ADD_ERROR 00007FFC26FE46D0 54 package body APEX_200100.WWV_FLOW_ERROR_API.ADD_ERROR 00007FFC0583F300 28 anonymous block 00007FFC1A6D09B0 2120 package body SYS.DBMS_SYS_SQL.EXECUTE 00007FFC1A8C79C0 590 package body SYS.WWV_DBMS_SQL_APEX_200100.EXECUTE 00007FFC1AC467F0 2621 package body APEX_200100.WWV_FLOW_DYNAMIC_EXEC.RUN_BLOCK5 00007FFC1AC467F0 1514 package body APEX_200100.WWV_FLOW_DYNAMIC_EXEC.EXECUTE_PLSQL_CODE 00007FFC18F950A0 2978 package body APEX_200100.WWV_FLOW_PLUGIN_UTIL.EXECUTE_PLSQL_CODE 00007FFC18CF24C0 487 package body APEX_200100.WWV_FLOW_DYNAMIC_ACTION_NATIVE.AJAX_EXECUTE_PLSQL_CODE 00007FFC18CF24~ |
The method apex_error.add_error is not supported in PL/SQL code executed through the dynamic actions.
It requires page submit and work well in the process.
You can try to copy that PL/SQL code you have written in the DA and create a process and paste it there.
Make the button to submit the page, and your code will work.
I made a new modal page with an item and a button with Action = submit page, I associate a process with the following code and it works fine
apex_error.add_error (p_message => ‘ANY ERROR’, p_display_location => apex_error.c_inline_in_notification);
But in my original modal page, I put a new button with Action = submit page, I associate a process with the previous code and it keeps showing the error
It is really weird.
Check thoroughly, maybe the error is happening in other processes.