>Thanks Erik,
> This is a clip of the delete routine in trouble. Like you said, AERROR returns the last VFP error, however, this is a new "legit" delete that is failing. How do you trap failed and successful triggers???
>
I always handle this by checking the return results of TABLEUPDATE(), but obviously, this only works with buffering on. If you don't want to use buffering (I highly recommend that you do), I guess you could just check the value of DELETED() right after you delete the record. If the record was not successfully deleted, then you could check AERROR().
>DELETE IN (.cPrimaryAlias)
>IF AERROR(aDeleteError) > 0
> IF aDeleteError[1] = 1539 ; && Trigger failed
> AND aDeleteError[5] = 3 ; && Delete Trigger
> .Error(aDeleteError[1]) && For message Only
> .Revert()
> RETURN .F.
> ENDIF
>ENDIF AERROR(aDeleteError) > 0
>
>Thanks...
Erik Moore
Clientelligence