Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Rules part 2
Message
From
17/03/2004 22:01:39
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
17/03/2004 18:37:48
Steven Kleypas
Tarrant County College District
Texas, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00887336
Message ID:
00887375
Views:
9
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.

*Of course, we're assuming your alias is buffered here!!
IF INLIST(GETFLDSTATE("AgencyName", YourAliasName), 2, 4))
   **Do your test here against tcAgencyName value and set llRetVal = .F. if it's not unique.
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform