ApexLib: New release v0.16 – Error Handling improvement

Just have uploaded release v0.16 of the ApexLib Framework. The new release doesn’t contain a new “big” feature, but I think the new enhancements are still useful.

The new procedure ApexLib_Error.addApexValidationErrors can be used to catch the errors raised by page validations and show them as inline error messages without having to re-render the page. How to use it?

  1. Create a new page level validation
    • Name: Show validation errors
    • Type: PL/SQL Error
    • Sequence: 99 (has to be the last validation!)
    • Validation Expression 1:
      ApexLib_Error.addApexValidationErrors;
    • Error Message: Error
    • Error message display location: Inline with Field and in Notification
  2. Try out the example page where I have created the following check for Hire Date
    ApexLib_Item.DV('P31_HIRE_DATE') <= TRUNC(SYSDATE)

    As you will see it’s also displayed without having to re-render the page. That’s maybe sometimes useful when you want to avoid that values in a tabular form are discarded because of re-rendering the page.

The known restriction, that items/column/regions which had an assigned authorization where ignored by the different checks, has been removed. The framework now checks if the user has the authoriziation.

Update 06-Jan-2007: There was an error in ApexLib_Region.pkb, I have uploaded an update of the release.

List of the covered enhancements by this release

  • CR# 1628158: Add functionality get the APEX validation error stack
  • CR# 1627230: Remove the restriction for items/regions/tabular forms with an authorization

Files added/changed:

5 thoughts on “ApexLib: New release v0.16 – Error Handling improvement

  1. When using standard Oracle Apex you get a very ugly error message when you submit a record that has been changed by another user. Does ApexLib have a solution for this?

  2. I’m very new to Oracle APEX so I do not know how this situation is handled normally. But it could be something for a future release, sure.

    great stuff, thanks

  3. Hi Rene,

    what you currently see is the default behavior of the “automatic DML” process which can’t be changed. Sure you can write your own process which does the insert/update/delete for you, but trust me you don’t want to go this road because in that case you have to care about everything by yourself, like lost update detection, locking, error handling, …

    I have logged an enhancement request and will look what I can do to beautify this error message.

    Patrick

  4. Hi Patrick

    I have a question about your example. Where do I have to create the check for Hire Date?

    I have a pl/sql after-submit process that do some validations and depending on the result it has to show an error or a success message in the same page. The problem is that if I use raise_application_error the message is not friendly. I am trying to apply your solution but I do not know how to.

    Any help will be really appreciated!!!
    Regards
    Jeannine

Comments are closed.