Friendly Errors?


Is there a way i can set the system to show friendly errors?

I did a test where two uses enter the same Lead ID (which is a Unique field in the MySQL DB) and I get the following error when adding a lead with a duplicate Lead ID.

Id rather it validate the form on submit, pick a new number and insert that automatically, and the validation error will say its already in use and thats it’s been changed automatically etc etc …


CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘7662’ for key 2. The SQL statement executed was: INSERT INTO leads…[/i][/color]

You can use CUniqueValidator for it.

Thanks i’ll take a look.