Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Rules part 2
Message
De
17/03/2004 22:01:39
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
17/03/2004 18:37:48
Steven Kleypas
Tarrant County College District
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00887336
Message ID:
00887375
Vues:
11
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform