Page 1 of 1

Duplicate value & custom message

Posted: Sat Feb 10, 2018 12:12 am
by hk_agserna

Hello, using asp.netmk 10 (vb.net)
Need to set custom message on check duplicate values, i mean different messages for different fields, not only lang.xml value.
Any help?
thanks for support.


Re: Duplicate value & custom message

Posted: Sat Feb 10, 2018 12:26 am
by kirondedshem

You can customise the phrase in any server event in language load like below

//set the duplicate indicator
SetPhrase("dupindex","A '%f' called '%v' already exists");

But the customisation you want per field is not yet supported since i think they all use the global phrase for all fields.

If you want it customised to that level I suggest you manually add your code in row_inserting to check each duplicate value ad return desired specific error message


Re: Duplicate value & custom message

Posted: Sat Feb 10, 2018 1:10 am
by hk_agserna

thks, can't find any "language load" event....
Could you clarify please?


Re: Duplicate value & custom message

Posted: Sat Feb 10, 2018 1:15 am
by kirondedshem

you dont have to use language load, you can event put it in page_load of your add/edit pages or in global page load event.

BUt as i said that still sets it globally, you need to add checks in row_inserting for a more custom one


Re: Duplicate value & custom message

Posted: Sat Feb 10, 2018 1:36 am
by hk_agserna

Got it!!
Thks