LPARAMETERS nError, cMethod, nLine
LOCAL laError[AERRORARRAY], ;
lcMessage
*- make the Tastrade database is selecected
IF EMPTY(DBC())
SET DATABASE TO Tastrade
ENDIF
=AERROR(laError)
DO CASE
CASE nError = 1884 && Primary key violated
?? CHR(7)
=MESSAGEBOX(CUSTIDEXISTS_LOC, ;
MB_ICONEXCLAMATION, ;
TASTRADE_LOC)
this.txtCustomer_ID.SetFocus()
CASE nError = 1582 && Field rule violated
?? CHR(7)
*-lcMessage = DBGETPROP(ALIAS() + "." + laError[3], "Field", "RuleText")
*- lcMessage = STRTRAN(lcMessage, '"', '')
lcMessage = laError[3]
=MESSAGEBOX(lcMessage, ;
MB_ICONEXCLAMATION, ;
TASTRADE_LOC)
DO CASE
CASE LEFT(UPPER(laError[3]),11) = "CUSTOMER ID"
this.txtCustomer_ID.SetFocus()
CASE LEFT(UPPER(laError[3]),12) = "COMPANY NAME"
this.txtCompany_Name.SetFocus()
CASE UPPER(LEFT(laError[3],7)) = "MINIMUM"
this.txtMin_Ord_Amt.SetFocus()
CASE UPPER(LEFT(laError[3],7)) = "MAXIMUM"
this.txtMax_Ord_Amt.SetFocus()
ENDCASE
OTHERWISE
IF PEMSTATUS("THIS.PARENT","ERROR",5) == "Method"
THIS.PARENT.ERROR(nError, cMethod, nLine)
ENDIF
ENDCASE