Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FieldBeingValidated()
Message
 
 
To
02/04/2002 12:30:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00639971
Message ID:
00640016
Views:
21
>>>Is there any way that a generic field-level-validation rule can determine the name of the field being validated?
>>>
>>>The only thing I can think of is to use a naming convention for the validation rules and then check the name of the PROG() running.
>>>
>>>Any other ideas?
>>
>>Our rules have two parameters: field value and a field name. I doubt, what you can obtain this info inside the rule without passing it as a parameter...
>
>That's what I figured.
>
>I'm curious. How do you pass the field value and field name to your rules?
>I'm guessing that your rule for Field1 would be:
>"Field1_Validation(Field1,'Field1')". Is that right?
>Or is it a generic rule
>like "GenericRule(Field1,'Field1')"
>and "GenericRule(Field2,'Field2')" ?
>Why do you pass the field value, can't you just check the value from within the rule?

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
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