IF NOT TABLEUPDATE( 1, .F., 'MyAlias' ) *** An error occurred. Find out what it was IF NOT This.HandleError() RETURN .F. ENDIF ENDIFHandleError method should look something like this:
LOCAL laErrors[1], llRetVal, loUpd, lnMsgNo llretVal = .T. AERROR( laErrors ) DO CASE CASE laErrors[1] = 1539 && Trigger failed DO CASE CASE laErrors[5] = 1 && Insert Trigger MESSAGEBOX( 'Insert Trigger Failed', 16, 'Unable to Insert Record' ) llRetVal = .F. CASE laErrors[5] = 2 && Update Trigger MESSAGEBOX( 'Update Trigger Failed', 16, 'Unable to Update Record' ) llRetVal = .F. CASE laErrors[5] = 3 && Delete Trigger MESSAGEBOX( 'Delete Trigger Failed', 16, 'Unable to Delete Record' ) llRetVal = .F. ENDCASE CASE laErrors[1] = 1585 && Update Conflict *** Instantiate the upodate conflict handler to handle the conflict loUpd = CREATEOBJECT( 'updres', ThisForm.DataSessionID, .cPrimaryTable ) IF TYPE( 'loUpd' ) = "O" AND ! ISNULL( loUpd ) loUpd.Show() ENDIF llRetVal = .T. CASE laErrors[1] = 1884 && Duplicate key MESSAGEBOX( 'Duplicate Key', 16, 'Unable to Save Record' ) llRetVal = .F. OTHERWISE MESSAGEBOX( 'Unknown Problem', 16, 'Unable to Save Record' ) llRetVal = .F. ENDCASE RETURN llRetVal