Error creating a new record (unique key exists)

Hello Radzen team,
when i add a new record in Radzen and for example a unique key violation occurs Radzen quits it with a message "Unable to create new (e.g) Artikelarts".

How can i create a message that is more illustrating for the user? Something that explained what happens?
I think the server side is the right place to do this. Analyzing which error occurs and setting the message text. Something like this....

Kind Regards
Thomas

Hi Thomas,

In my opinion it will be better if you let the database to auto-generate the primary keys similar to our Sample database:

In this case Radzen will not auto-generate Form fields for your primary keys for add/edit pages and the user will unable to enter existing primary key values.

Best Regards,
Vladimir

Hi Vladimir,
i dont mean Identity Columns. I use them in every Table because they work great and will never give a unique key violation. thats not my suggestion.
I talk about Unique Key that are not PK’s or Identity Columns.
E.g. my Table “Artikelarten”. This Table has 4 Columns.

  1. Identity Column: ArtikelartID
  2. Text varchar2(50)
  3. handelsware bit
  4. aktiv bit

Column 2 Text has a unique constraint on it because it should never! be that the same text is twice or more in Artikelarten.
I dont want to control that programmatically. errors are preprogrammed.

I only want to show the user what he has done wrong. Im sure that user will call me when they are producing unique violations like this with only the message “Unable to create new Artikelarts” at hand.

Kind Regards
Thomas

Hi Thomas,

I see now! In this case you can use OnXXXXCreated partial method server-side to check for example if posted value(s) are not unique and raised your own custom exception.

Best Regards,
Vladimir