Hi, I have a requirement like i want to display customize message to user when user adding duplicate record in form.
example:- I created entity(States) already state there in DB again entering from UI with same name.
exception throwing because i set Index as Unique for that state name attribute.
Now, i want display cutimise exception message to user instead of DB exception message.
please advice
Hi,You can use exception handler inside your Save action.As shown belowRegardsKrishnanand Pathak
I would say, validate before update in your crud wrapper
So do an aggregate with filters : different id, same name
If found, don't do the update/create and set your own exception with proper text ( or some other way of communicating problem back to screen)
Dorine
how to do with aggregate. can you share a example if you handy ?
Hi ,
In addition of @Dorine Boudry said , the implementation is in below oml.
thank you Rahul
Hi @kishore reddy
If you applied unique index to your entity then in action when you save new record use these exception handler there in same action because if duplicate record came then it'll raise an exception.
By default all exception handled here OnException if you don't handle it in your action.
I hope it'll help you.
ThanksDeep