EBS Customizations (MOSC)

MOSC Banner

How to customize OAF exception message according to the type of errors ?

edited Aug 29, 2021 8:35AM in EBS Customizations (MOSC) Question

I used a try catch for a commit when creating rows, what I want is to detect SQL constraint exceptions in order to display the appropriate message, for example for the exception below, I want to display this message: "You can't insert two planning for the same period ! "

Here is my java code, where I handle the exception:

  public void createOneRow(String person_id, oracle.jbo.domain.Date Datefrom, 

    oracle.jbo.domain.Date Dateto) {

    Number Val2 = null;

    try {

      Val2 = new Number(person_id);

    } catch (Exception e) {

  throw new OAException("Exception " +e, OAException.ERROR);

    }   

      OcVORowImpl ro; 

      ro = (OcVORowImpl)this.createRow();

      ro.setAttribute("PersonId", Val2);

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center