This discussion is archived
8 Replies Latest reply: Dec 10, 2012 10:56 AM by TexasApexDeveloper RSS

User friendly message from AJAX call

Cleopatra Newbie
Currently Being Moderated
Hi all,

Is there a way to make the error message from a dynamic action more user-friendly.
I have this dynamic action which sets a value for a certain item based on a condition, but when I get an exception I would like to display
a user friendly message.

Can anyone help?

Kind regards,
Cleopatra



Apex version: 4.1
Db version : 11.1.0.6.0
  • 1. Re: User friendly message from AJAX call
    TexasApexDeveloper Guru
    Currently Being Moderated
    Custom error handler? That way you can code the exception messages that you want to display, as long as they're not an internal APEX error...

    Thank you,

    Tony Miller
    Ruckersville, VA
  • 2. Re: User friendly message from AJAX call
    VC Guru
    Currently Being Moderated
    Cleopatra wrote:
    Hi all,

    Is there a way to make the error message from a dynamic action more user-friendly.
    I have this dynamic action which sets a value for a certain item based on a condition, but when I get an exception I would like to display
    a user friendly message.
    What exception you are getting? is there any PL/SQL code involved?
  • 3. Re: User friendly message from AJAX call
    Cleopatra Newbie
    Currently Being Moderated
    Hi,
    I am getting the following:
    "AJAX call returned server error ORA-01403: No data found for Set Value."
    How can I make this message more user friendly in the dynamic action?
    Yes I set the value using PL/SQL in the dynamic action.


    Regards,
    Cleo
  • 4. Re: User friendly message from AJAX call
    VC Guru
    Currently Being Moderated
    Cleopatra wrote:
    Hi,
    I am getting the following:
    "AJAX call returned server error ORA-01403: No data found for Set Value."
    How can I make this message more user friendly in the dynamic action?
    Yes I set the value using PL/SQL in the dynamic action.


    Regards,
    Cleo
    Hi Cleo,

    Would you tell the user that An error occurred every time they run through no_data_found ?.

    No Data found is not an unexpected error, should you not handle it in your code by adding an exception block??
    exception 
      when no_data_found then
       return null;
    end;
    Even though if you add the above exception block still you may get different ORA-error and it seems that you have not implemented the error_handling function.

    So as Tony already suggested create this error handler function and define it in your application definition.

    Thanks,
    Vikram
  • 5. Re: User friendly message from AJAX call
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Cleo,

    for completeness, the "error handling function" of APEX will not be called for AJAX calls in APEX 4.1. But the good news is that in APEX 4.2 this has been changed and you can now always use "Error Handling Function" to modify any error message raised by APEX or your application.

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 6. Re: User friendly message from AJAX call
    Cleopatra Newbie
    Currently Being Moderated
    Thanks Vikram,

    But I am indeed still getting that error, even though I have an exception block present in the pl/sql code.
    And like Patrick said that that error Handling functions will not be call from AJAX Calls and in Apex 4.2 it is possible to modify error messages.
    Thanks for you time anyway.

    Regards,
    Cleo
  • 7. Re: User friendly message from AJAX call
    Cleopatra Newbie
    Currently Being Moderated
    Thanks for that info Patrick.
    I guess I will upgrade to Apex 4.2 so I can check that out.


    Kind regards,
    Cleo
  • 8. Re: User friendly message from AJAX call
    TexasApexDeveloper Guru
    Currently Being Moderated
    Can you post the code in question? Or can you post an example online @ the hosted Oracle instance? Might be able to help better that way..

    Thank you,

    Tony Miller
    Ruckersville, VA

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points