Raise Application Error on Dynamic Action

Hi
I am using Apex 4.2. On a click of button a Dynamic Action is written, which calls a DB Package. The DB package has exception handlers and also the package has two output parameters
Error Code and Error Msg
So in my code(Dynamic Code) i make a call to the package and checks the value for Erroc Code.
Begin
Package call......
  If v_error_code <> '0' Then
    Raise SC_Error;
  End if;
Exception
  When SC_Error Then
    RAise_Application_error(v_err_code, v_err_msg);
End;
But when i run the page and I click I get an Internal exception error
Output from Debug -- I am not sure what the Cell in Red colour means, because the package is returning a correct message (before the red line).Can anyone help please??
Thanks
JS
......message: AJAX call returned server error ORA-20003: Customer has already been matched for Execute PL/SQL Code.
4
......is_internal_error: true
4
......apex_error_code: APEX.AJAX_SERVER_ERROR
4
......ora_sqlcode: -20003
4
......ora_sqlerrm: ORA-20003: Customer has already been matched
4
......error_backtrace: ORA-06512: at line 41 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 973 ORA-06512: at "SYS.WWV_DBMS_SQL", line 999 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 830 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 2304 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 442
4
......component.type: APEX_APPLICATION_PAGE_DA_ACTS
4
......component.id: 23185203797756209
4
......component.name: NATIVE_EXECUTE_PLSQL_CODE
4
...Execute Error Handling Callout defined on Page or Application Level
4
...Execute Statement: begin declare l_error wwv_flow_error_api.t_error; begin l_error := wwv_flow_error_api.g_error; wwv_flow_error_api.g_error_result := apx_error_utils.handleerror ( p_error => l_error ); end; end;
4
......Values changed by callout:
4
.........message: An unexpected internal application error has occurred. Please get in contact with your system administrator and provide reference# for further investigation.
4
.........display_location: ON_ERROR_PAGE
4
Stop APEX Engine detected
4
Final commit
4
1 - 59

Edit: Well, Patrick beat me to the punch because I was taking my jolly time writing this down
Well, if you look below the part you put in red, you can see that a callout is made: ...Execute Error Handling Callout defined on Page or Application Level
With directly below that:
......Values changed by callout:
4
.........message: An unexpected internal application error has occurred. Please get in contact with your system administrator and provide reference# for further investigation.
Since the plsql call is on the serverside, this error is trapped within the error handling function aswell. Your error has simply been obscured by it, and probably because it looks at the error backtrace and determines the error is internal.
Looking at the sample error handling code, this is probably where it goes "wrong":
-- If it's an internal error raised by APEX, like an invalid statement or
  -- code which cannot be executed, the error text might contain security sensitive
  -- information. To avoid this security problem rewrite the error to
  -- a generic error message and log the original error message for further
  -- investigation by the help desk.
  if p_error.is_internal_error then
I recreated the situation here, and put some debug in the error handling function just so I could see what sort of error is being processed:
    apex_debug.message('error code: '||p_error.apex_error_code);
    apex_debug.message('sql code: '||p_error.ora_sqlcode);
    apex_debug.message('sql errm: '||p_error.ora_sqlerrm);
    apex_debug.message('error_backtrace: '||p_error.error_backtrace);
0.05750
0.00007
...Error data:
4
0.05757
0.00006
......message: AJAX call returned server error ORA-20099: raise application error for Execute PL/SQL Code.
4
0.05763
0.00006
......is_internal_error: true
4
0.05769
0.00005
......apex_error_code: APEX.AJAX_SERVER_ERROR
4
0.05774
0.00005
......ora_sqlcode: -20099
4
0.05779
0.00006
......ora_sqlerrm: ORA-20099: raise application error
4
0.05785
0.00005
......error_backtrace: ORA-06512: at line 1 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1064 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1090 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 832 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 2304 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 442
As you can see, the ajax error is an internal error, and that is why it is handled as such in the error handler. With this info you should be able to adjust your handling function. Test for the error code (APEX.AJAX_SERVER_ERROR) and then throw the error message or test for the -20000 range of custom errors for example.
    if p_error.is_internal_error then    
        -- Access Denied errors raised by application or page authorization should
        -- still show up with the original error message
        -- do not parse ajax server errors here !
        if    p_error.apex_error_code <> 'APEX.AUTHORIZATION.ACCESS_DENIED'
          and p_error.apex_error_code not like 'APEX.SESSION_STATE.%'
          and p_error.apex_error_code != 'APEX.AJAX_SERVER_ERROR'
        then
It probably does need some more work but you should get the gist of it.

Similar Messages

  • Regarding an error in Dynamic action for hiring

    Hi Experts,
    when i perform a hiring action"AA" for action type "02" or "01" using a dynamic action .it is throwiing an error.
    " perform not found" "CX_SY_DYN_CALL_ILLEGAL_FORM"
    "MP000000" OR " MPPERS00"
    "MEASURE"
    please let me know how to proceed .
    regards
    Vishnu

    Hi Vishnu,
    this might just give you a clue and as suggested by our mate,you may need to debug it and see the code.
    PERFORM_NOT_FOUND short dump
    http://help.sap.com/abapdocu_70/en/ABAPPERFORM_GENERAL.htm
    No Worries
    KG
    Edited by: SAPenjoy:) on Sep 6, 2010 8:44 AM

  • How to raise application error and preserve open cursor...

    Hello,
    I have to raise an application error under certain circumstances.
    In some cases there's an open cursor that has to be read by the calling application anyway because there are data that have to be read.
    In other cases the cursor does not have to be read.
    sample code:
    create or replace procedure get_address(
    pv_street varchar2,
    pv_number varchar2,
    pr_retid in out number,
    pr_refcurs in out get_streetpkg.t_refcurs )
    v_rowcount number;
    v_no_suiting_number boolean := false;
    begin
    delete temp_addr;
    -- get suiting rows
    insert into temp_addr
    select * from addr
    where street like pv_street
    and number like pv_number;
    v_rowcount := sql%rowcount;
    -- if no suiting row found then get all
    -- suiting streets regardless of number
    if v_rowcount = 0 then
    v_no_suiting_number := true;
    insert into temp_addr
    select * from addr
    where street like pv_street;
    end if;
    -- check whether data has been found
    select count(*)
    into v_rowcount
    from temp_addr;
    -- set return id if only one row is found.
    if v_rowcount = 1 then
    select id from temp_addr
    into pr_retid;
    end if;
    -- open cursor to provide data
    open pr_refcurs for
    select * from temp_addr;
    -- generate error - if no data found at all
    -- no data has to be read...
    if v_rowcount = 0 then
    raise_application_error( -20001, 'no data found' );
    end if;
    -- generate error - or better notification - message if no number found...
    -- SELECTED ROWS HAVE TO BE READ ANYWAY!!!
    if v_no_suiting_number then
    raise_application_error( -20002, 'streets found, but no suiting number' );
    end if;
    return;
    end;
    Prerequisites:
    - The calling application reads the open cursor and closes it.
    - The application cannot provide additional arguments and the stored proc cannot be converted into a stored func.
    - I cannot put the procedure into a package.
    - The application has to get information about success or failure (and reason of failure) through provided error numbers (-20999..-20000).
    Whenever the error is raised and pr_retid was set, retid is not set in the application, neither is the cursor.
    So what can I do to provide return ID and row data???
    Hope anyone can help me.
    Greetings, Heiko Kaschube
    null

    Sorry, I didn't read your list of pre-requisites carefully enough. Your problem is that prerequiste #4 (return Application Error number) is in flat contradiction with prerequisite #1 (calling application continues processing).
    To restate: RAISE_APPLICATION_ERROR means "the called program has encountered a problem so please cease processing and handle the error". Using RAISE_APPLICATION_ERROR prevents the calling program doing any more processing: control goes to the EXCEPTION handler. Therefore RAISE_APPLICATION_ERROR should only be used for abnormal processing conditions.
    I fail to see why you want to use RAISE_APPLICATION_ERROR to handle a situation which is quite obviously not an application error: your called program has found some data that you want to process.
    yours in puzzlement, APC

  • Problem after raising application error

    Hi,
    I would really appreciate any insight on this issue. Thanks.
    I have a page that has fields that submit when entered. There is no problem there.
    I have a button that when clicked runs a process and if certain condition happens to occur then it calls the raise_application_error.
    I click OK and it takes me back to the previous page.
    Problem doesn't go away if I fix the problem and press enter.
    What do I have to do to reset to the submit button (which by the way is hidden) and not the print button which also submits the page.
    Thanks in advance

    Thanks Scott
    I had a few things happening. But I figure out how to prevent it by getting some correct values to begin with.
    The issue about the button and getting the error over and over is something related to a value on a field that is not reset. I'm not using collections.
    Solve this issue I'm just telling the customer to do a refresh and that gets rid of the negative values that raises the error.
    Thanks

  • XML import raises application error / event code "AVAA0-3208-0"

    I receive an application error when trying to import a specific XML file. Other XML files, that have been created with the same tools and sequence but from another MS Project file, can be imported without an issue.
    There is no warning or error in Primavera's log file.
    Here is the error message's content:
      Type: EAccessViolation
      Event Code: AVAA0-3208-0
      Description: Access violation at address 01136627 in module 'PM.exe'. Read of address 00000000
      Object: TVUltraButton
      Context: TfrmWizImport.RunImportWizard / TDevxMainForm.actFileImportExecute / TCFormManager.SetToolbar / TDevxMainForm.BeforeFormShow / TfrmLogin.FormCreate
      Primavera version: R8.3.2
      OS: Windows XP (NT5.1) SP3
    Has anyone an idea about what the root cause (XML content issue) might be?

    based on the details provided, this is not a permission issue since you are able to import other similar MSP XML files so it could be a data issue in the XML file being imported.
    Can you try modifying the XML file and remove activities and just keep a few activities, then save as a new XML file and try again. I think you can try narrowing down the issue with some tests to see if it's a problem with the XML or not.

  • Not able to use raise application error in oracle forms

    Below is my code
    When in used rasie_application_error in program unit proc
    Iam getting compilation error
    'identifer RAISE_APPLICATION_ERROR' must be declared.
    I have used this in my exception below is the code.
    Exception
         WHEN NO_DATA_FOUND THEN
    RAISE_APPLICATION_ERROR (-20001, 'This ID is invalid');
    END;
    Can anyone help me in this

    RAISE APPLICATION_ERROR built-in is raised in a DB procedure/function or trigger.
    You can write an ON-error trigger that will trap any DB error messages
    or
    You can use Dbms_Error_Code & Dbms_Error_Text for trapping the Error.

  • Forms, RAISE Application Error

    Hi,
    How to get the message in forms (front-end) from Oracle DB procedures/triggers.The message is being used in a RAISE APPLICATION_ERROR built-in in the DB procedure.
    Is there any other ways to communicate the messages from back-end to front-end.
    Thanks.
    [email protected]
    null

    Sure. You can write an ON-MESSAGE trigger that will trap any DB error messages. An example of code that will capture Oracle Message Number 40301 is shown below:
    DECLARE
    messg_num number := message_code; -- DB error message code.
    messg_text varchar2(80) := message_text; --DB error message text.
    messg_type varchar2(3) := message_type; -- BD error type.
    BEGIN
    IF messg_num = 40301 THEN
    MESSAGE('No records matching you criteria were found from the database.');
    DISPLAY_ERROR;
    ELSE
    MESSAGE(messg_type&#0124; &#0124;'-'&#0124; &#0124;to_char(messg_num)&#0124; &#0124;': '&#0124; &#0124;messg_text);
    END IF;
    END;
    You can further refine this code by actually trapping the error message in alert display that you can design on your form.
    Hope this help you.
    Abdul
    null

  • How to read the DB application error in JSP

    We have the PL/SQL triggers that perform validations on the insert and update. If validation fails the RAISE APPLICATION ERROR is used.
    On error the errorpage.jsp is called correctly, but my problem is that I can not read the actual error message from database.
    All I am getting from exception.getMessage() is the JBO message. The exception.printStackTrace() does not help either. How can I read text of PL/SQL exception message ?
    I have tried this test in errorpage:
    if( exception instanceof oracle.jbo.JboException ) { ...}
    but apparently the exception is not JboException, since test fails.
    I read about ApplicationModule.setExceptionHandler() and even build exception handler which does not do anything. I assumed that this would allow all exceptions to be passed to the error page. Nothing like that happens though. I still see only last JBO exception, I can not see the original DB exception.
    Thanks in advance,
    Michael

    Hi ankur,
    thanks for the quick reply,
    I have got the answer for the first question.
    Can u tell me solution for the 2nd question also. how to read the Portal user information in VC. like reading the Portal user information in webdynpro.
    In webdynpro we can read any of the portal user properties or information like using the following code.
    Itry{
    IWDClientUser user = WDClientUser.getCurrentUser();
    String fName = user.getFirstName();
    String lName = user.getLastName();
    }catch(Exception e){
    In the same way to read the portal user information in VC. BCz for every portal user we have created one custom properties, we need to read that propety value in my vc application, when the user logged in to portal and accessing integrated VC application.
    I have seen one of the thead this is possible from VC7.0 of NW2004s, current my version is also the same.
    Portal 7.0
    VC 7.0
    If u know how to do that, can u let me know.
    Regards
    Vijay

  • How to raise Error Message in foreground through Dynamic Action?

    Hi,
    I have a requirement where I have to raise an error message in foreground so as to stop processing whenever HR_INFOTYPE_OPERATION fails to update a record in a dynamic program. I tried using MESSAGE statement but it did not work, as the error message was not displayed properly on the Infotype screen that calls the dynamic action.
    For ex.: If infotype PA0000 is calling PA0014 through dynamic action, then I want the error message to be displayed on the Actions Screen of PA0000.
    Is there any specific way to raise error messages through dynamic action programs?
    Quick answers will be appreciated.

    HI Sanjana,
    In the Substitution exits you can create the message in the configuration it self.
    You dont't need raise message explicitly.
    Thanks,

  • Latest Error Handling for Dynamic Actions

    Is there any documentation on the Latest Error Handling for Dynamic Actions?

    BillC,
    Interesting that I was looking around for the same thing after seeing a Foreign Key violation in my application.
    I found this article by Patrick Wolf:
    APEX 4.1 – Error Handling Improvements – Part 1
    http://www.inside-oracle-apex.com/apex-4-1-error-handling-improvements-part-1/
    I believe you need to be on 4.1 or later though.
    Thanks,
    Joe

  • How to display an error message in Dynamic Actions

    Dear Team:
    Scenario as below:
    Whenever the user creates Contract Elements Record, the begin date should be checked with the hire date in 0041 - Date specifications infotype (Date type) and Date of hire. If this is not equal to, then record should be rejected with an error message. Please let me know how do I write the lines in table V_T588M for infotype 0016.
    HOW TO INSERT AN ERROR LINE TO BE DISPLAYED IN DYNAMIC ACTIONS.
    Regards
    Team Member.
    Edited by: Patlolla Mallikarjun on Jul 8, 2009 1:53 PM
    Edited by: Patlolla Mallikarjun on Jul 12, 2009 10:13 AM

    No replies.

  • Dynamic Action Set Value - PLSQL Error - cannot contain an expression

    I am trying to use below in a Dynamic Action to Set Value with PL/SQL Function. The dynamic action does not update the item appropriately. I tried to run the below directly in SQL Workshop but received the error "PLS-00372: In a procedure, RETURN statement cannot contain an expression". How can I get below to return the value needed?
    DECLARE
    rqstdaloe number;
    rqstdeloe number;
    devpercent number;
    rqsttarget date;
    timeleft number;
    PSPTime number;
    DevTime number;
    DevPer number;
    BEGIN
    SELECT SUM("TRACK_TIME_SPENT") INTO rqstdaloe
    FROM "TIME_TRACKER"
    LEFT JOIN "TBL_R66_TASK_TYPE" ON "TASK_TYPE_ID" = "TRACK_TYPE"
    WHERE "TRACK_REQUEST_ID" = :P2_REQUEST_ID AND "TASK_TYPE_TYPE" = 'DEV';
    rqstdeloe := :P2_REQUEST_ELOE;
    SELECT SUM(TT1."TRACK_TIME_SPENT") INTO DevTime
    FROM "TIME_TRACKER" TT1
    LEFT JOIN "TBL_R66_TASK_TYPE" TT2 ON TT1."TRACK_TYPE" = TT2."TASK_TYPE_ID"
    WHERE TT1."TRACK_USER" = :P2_PSP_ASSIGNED_PRIMARY AND TT2."TASK_TYPE_TYPE" = 'DEV';
    SELECT SUM(TT1."TRACK_TIME_SPENT") INTO PSPTime
    FROM "TIME_TRACKER" TT1
    WHERE TT1."TRACK_USER" = :P2_PSP_ASSIGNED_PRIMARY;
    DevPer := ROUND(DevTime/PSPTime,2)*8;
    timeleft := TRUNC(((NVL(rqstdeloe,0) - NVL(rqstdaloe,0))/DevPer)+.99999,0);
    rqsttarget := to_date(sysdate,'mm/dd/yyyy') + timeleft;
    RETURN rqsttarget;
    END;

    Hi Dave,
    just a quick hint. If you just want to have the time part of a date/sysdate, you can use TRUNC to do that. So your existing code
    rqsttarget := to_date(sysdate,'mm/dd/yyyy') + timeleft;could be changed to
    rqsttarget := trunc(sysdate) + timeleft;If you perform a TO_DATE on a date variable, the PL/SQL engine will first convert that date variable with an implicit type conversion to a VARCHAR2, because the TO_DATE interface only supports VARCHAR2's and NUMBER's.
    But implicit type conversions are always dangerous, because if your default date format mask isn't mm/dd/yyyy your TO_DATE will fail.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Raising an error in application process?

    How can I raise an error in an application process?
    the application process in on-load before header
    I want to check something at this event
    when not ok I want to show the process error message that can be defined at the aplication process.
    The help text of this process error message says:
    Enter the text for an error message that can be displayed if the process fails.
    Can I programmatically raise that error?
    kind regards Erik

    succes message that I want to show, but the process error message.AFAIK, the same variable works for success or error. So you if you assign it a value it would be shown as the process message.
    If required, you can style it using HTML to identify between success and error cases
    &lt;span style=&quot;color:GREEN&quot;&gt;Successs Message&lt;/span&gt;or
    &lt;span style=&quot;color:RED&quot;&gt;ErrorMessage&lt;/span&gt;
    When I raise the error in the exception part I do get the process error message, but I also get User-Defined-ExceptionThen don't raise any exception, just assign the variable in the exception handler alone in the PLSQL Block.

  • Raise Application: FND, Message Name: FND-INVALID APPLICATION. error

    Hi,
    I have configured JDeveloper enverionment, and It run well testing page(test_fwktutorial.jsp). But I select the web link which in test_fwktutorial.jsp, it raise below error:
    oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND-INVALID APPLICATION. Tokens: APPL = null;
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1223)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1969)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
    at OA.jspService(OA.jsp:40)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    and it also raises Unexpected URL parameters have been detected and will be ignored. some times.
    This is my first doing JDeveloper, please help me, thank you very much.

    Jacks,
    when u will go through old threads, u will find that there is some fixed set of issues which cause this.
    --Mukul                                                                                                                                                                                                                                                                                                                               

  • Dynamic Actions in Visual Composer

    Hi,
    Can anyone help me with dynamic actions in VC.
    I am trying to open different popups based on my selection in a Drill Down Field.
    How can I do this?
    Where can I find an example for using Dynamic actions in Visual Composer?

    Hi
    Dynamic actions can be used to trigger actions when specific criteria is met. This can be used as a type of validation, checking if a specific field has been filled, to check if a user has permission to do a certain action. I have used it an it works in a simple model. I created a dynamic action using the following formula IF(@NUM1>1,'END','STORE') and then if the number was greater than 1 the application was stopped using an end point or data was stored using the STORE event and a datastore. You will get an error that the END and STORE events are declared but can not be raised, this will not cause a problem when you run the model.
    Jarrod

Maybe you are looking for

  • Error while deploying Sandbox Solution in SharePoint 2010 using Visual Studio

    Hi, I am creating a custom webpart as a sandbox solution. While deploying I am getting an error Error occurred in deployment step 'Retract Solution': <nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied. I have necessary permission

  • Dynamic sql versus static sql in a loop

    I have a loop that loops around 10 million times.Inside the loop I have a insert statement . To build this insert statement wondering if a) I should use Dynamic sql using bind variables or b) static sql. I am aware that static sql is always faster th

  • Can I combine @Id & @Temporal?

    I recently upgraded my IDE and it is flagging the following field in an Entity: @Id @Column(name = "HitDate", nullable = false) @Temporal(TemporalType.DATE) private Date hitDate;The error is that there is "More than one attribute configured for field

  • How to Flush DNS Cache in Mavericks 10.9.3

    So I have seen references to the following when searching for a cmd to flush DNS sudo killall -HUP mDNSResponder and sudo dscacheutil -flushcache Which one is proper for Mavericks 10.9.3?

  • How do i recover a folder I replaced

    I did a dumb thing and copied a file to my desktop.  It said there was already a file with that name and i said replace file.  Is there any way I can recover the folder I replaced?