How to customize OAF exception message according to the type of errors ?
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);