Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Constraint handling??
Fri, Jul 15 2022 12:21 AMPermanent Link

Ian Branch

Avatar

Hi Team,
If I handle a constraint like this for PostOnError...
{code}
 //
 if (E is EEDBError) then begin
   //
   case EEDBError(E).ErrorCode of
   EDB_ERROR_CONSTRAINT: begin
       tdConstraint.Content.Text := sMessage + 'has a data constraint error.' + #13 + EEDBError(E).ErrorMsg + #13 +
         'You will be returned to the Jobticket to correct either the Customer # and/or the Customer Reference.';
       tdConstraint.Execute;
       Action := daAbort;
     end;
   //
....
....
{code}

Should it still write the error to the System events Log?
"The unique constraint DupCustRefCheck for the table JobTickets has been violated (Duplicate key 466,VD75703 found)"

Regards & TIA,
Ian
Fri, Jul 15 2022 2:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


My personal view is yes.

This is based on Tim having no idea what code you are writing and by the time you handle the error it has already happened and trying to figure out wether or not its been handled in a satisfactory way or not would be a little difficult.

Roy Lambert
Fri, Jul 15 2022 3:41 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
Fair enough.  I was just worried that my handling wasn't happening.

Regards,
Ian
Image