Steven,
Typically, we've added code to the method used to test for uniqueness:
LPARAMETERS tcAgencyName
LOCAL llRetVal, lcRule
lcRule = 'Your error message text'
llRetVal = .T.
IF INLIST(GETFLDSTATE("AgencyName", YourAliasName), 2, 4))
ENDIF
IF llRetVal
This.ClearBrokenRule(lcRule)
ELSE
This.AddBrokenRule(lcRule)
ENDIF
RETURN llRetVal
Hope that helps,
---J
>I have set up a business rules class, testing for uniqueness, following the example of the MM Users and UserRules classes. It works great in finding if the value entered into my "txtAgencyName" textbox is unique.
>
>A problem occurs when editing a record, and the OK button on the page is pressed. The whole checkrules thing fires if a change is made anywhere on the form, even if the txtAgencyName is not entered or changed. It obviously is not able to determine if the value in the txtAgencyName is the same as the original value. What am I missing? Thanks in advance for any comments.