swiftinitpvtltd wroteI have a bulk edit grid with multiple dropdown. I also have mysql unique constraint(safest way to handle duplicate).
Now once aware IM throws unique constraint error for duplicate as user selected same drop downs for product and customer and date for example(unique key set for product and customer and date) how do I remove a row after error is thrown? Is there way in aware to handle mysql error and then handle it to remove row or customize that popup message that came from db?
IS there a reason why you haven't used a business rule to check uniqueness? That would handle AIM duplicates.
IF EXISTS BO WHERE BO.attributeToBeChecked=ThisBO.attributeToBeChecked AND BO.ID <> ThisBO.ID THEN REPORT ERROR'This record exists already. Duplicates are not allowed'
Prevents it being written to the database and you don't have to trap MySQL errors.