rado
Posts: 221
|
| Posted: 06/28/2009, 11:32 AM |
|
I have record form which works with table that has relationships with another table. So when I try to insert the record that already exist I got error message:
"Database Error: Duplicate entry '1-108-9' for key 1" which is OK. If record doesn't exist no error message show up. (OK as well).
The same record has in After Insert Event an additional sql query that is updating another table. (it works just fine). However when I get the "Database Error: Duplicate entry '1-108-9' for key 1" error message when I try to insert duplicate record I would like to skip the query written in "After Insert Event ". The way to do that is to somehow get DB error code from "Database Error: Duplicate entry '1-108-9' for key 1" message. I tried "if ($Container->Errors->Count == 0)" but it doesn't work since the error message is passed from DB.
My question is how I can get the database error code after any transaction.( In my case after insert.) so I can check it and make appropriate action (if success do additional query , if not skip additional query)
Thanks,
Rado
|
 |
 |
|