26
Views
4
Comments
Solved
Add message for unique fields in table Database exception
Application Type
Reactive

Hi all

I have a table with 2 unique example are Order and Name, when I update/insert data for these 2 field if duplicate they will show default error message of Outsystems. 

Can we change the error message base on each field?

ex:

- 'Name' is duplicate, please try again

- 'Order' is duplicate, please change your Order

I use the Database exception but can't change the message

Thanks


2023-02-06 14-27-11
André Smit
Solution


What about Raise Exception? Will this work for you?


UniqueFields_v2.oml
2023-02-06 14-27-11
André Smit

Hi @Bella Nguyen 

If I understand your problem correctly, please see the attached OML.

In the future, it might be easier to share your existing OML (if you are allowed). This just fast-tracks things a little bit.

UniqueFields.oml
UserImage.jpg
Bella Nguyen

Thank you for your reply, 

In my case I using index in table 

and Database Exception

I want to change this error message to my message

  I update your oml as my usecase, please check it

UniqueFields.oml
2023-02-06 14-27-11
André Smit
Solution


What about Raise Exception? Will this work for you?


UniqueFields_v2.oml
UserImage.jpg
Bella Nguyen

Thank you so much, it solved my issue.

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