177
Views
4
Comments
Solved
Exception handling

Hi guys,

As I have created an indexes to avoid a duplicate data entry in database. Once I click on save button if there is an duplicate values it gives an error but it is not user understandable.so how to make that error user understandable like display error message "Duplicate data entry" . See the attachment

Attach .oml if possible

Duplicate.PNG
2022-03-01 13-38-26
Suman Kumar Gope
Solution

Hi Rohan,

Hope you are doing well.

You need to handle DatabaseException and send Feedback
_Message (with Message Text like "Duplicate data" and Message Type = Entities.MessageType.Error) in the save screen action (or any other screen action that you are using to save those data in the database).

Request you to please check the attached screenshot and hope it will help you. 

Many Thanks,

SKG

Database_Exception.jpg
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

You can add an exception handler to your save action to catch the database exception and provide a user friendly feedback using a feedback message in the exception handler flow.

Regards,

Daniel


2023-10-02 01-26-46
Rafael M

But how to specify database INDEX type exception, because there are lots of possible database exceptions. Is there a way to catch specifically Database Index Exceptions?

2023-08-28 07-00-10
Paulo Torres
Champion

No. I believe he wants to return a generic message and also human readable.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.