Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FieldBeingValidated()
Message
 
 
To
03/04/2002 10:19:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00639971
Message ID:
00640387
Views:
24
>>
>>Here are our rule call and Error for the field:
>>VARTYPE(ovalid)="O".AND.(Ovalid.nlocked=0.OR.source(complevl,"CompLevl"))&& Field rule
>>
>>IIF(VARTYPE(ovalid)#"O","Field validation failure in COMPLEVL","") && Error
>
>
>I'm still curious about why you pass the field value to source(). Can't source() just read the value from the cursor, since it has the field name?

I think, it can, but this way simplifies the process...

>I also see that you skip the validation if Ovalid.nLocked=0. I'm trying to develope a class that skips the validation on the underlying DBF() during a TABLEUPDATE(), if it's already been done in the View. Any chance that's what your Ovalid.nLocked=0 is doing?

Hi Bill,

Well, Validation is not my application, but I can explain the basic rules, as I understand it:

All tables manipulations should happen in our JobControl application, that's why the first check is the existance of oValid object. If it doesn't exist, validation will return .f., so you can not do anything with the data.

We have two regimes: with validation turned on (oValid.nLocked = 1) and validations turned off (oValid.nLocked = 0). In majority of applications like Address Strandardiztion, Zipping, TaxCalc, etc., we turn the validations off. In some of them, like Validate Data, Resolve errors, BldMstr Editor, few others, we turn them on by setting oValid.nLocked to 1.

We also have two different modes of running validations: in batch mode and in Interactive mode. This is also handled by some properties of oValid object and some special code...

All our validation methods are stored in a table (in several related tables, to be precise) and we have a visual interface to change them... I can send you our Methods form screen shot, if you'd like, and the resolve validation screen...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform