replace messages


where can i replace these messages ??



Cannot insert duplicate key row in object 'dbo.OSUSR_NN8_BASEDEDATO' with unique index 'OSIDX_OSUSR_NN8_BASEDEDATO_3RUT'. The duplicate key value is (15.103.650-3). The statement has been terminated.




Hi Hector,

You are having a database error because you are creating duplicate record even though you have assigned the entity unique. So if you want to change the error message according to your convenience, you can make a database exception in your action and add a feedback message as shown in the picture.

I hope it helps.

Regards,

Divyanshu

Hi,

Go to the action where the error is getting raised, try to handle the exception and in that flow you can put your custom message in feedback

Regards.

Hi Hector,

You are having a database error because you are creating duplicate record even though you have assigned the entity unique. So if you want to change the error message according to your convenience, you can make a database exception in your action and add a feedback message as shown in the picture.

I hope it helps.

Regards,

Divyanshu

Hi Hector,


handling this exception after it is thrown might not be your best option, if you put in a exception handler for database exceptions, your user will only know that something went wrong in the database, but not what. 

Try to avoid all exceptions that you can.  

For example, if you have a unique index in a table, do a validation before the create or update, verifying that there is no other record yet with the same value for that index.  You can then, if that validation fails, raise an exception with the appropriate user message.


Dorine

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