Cruizectrl
asked on
Validation by Calculation
FMP 8 again
How do I set a "not empty" validation on field3 if field1 = "x" and field2 = "y"
How do I set a "not empty" validation on field3 if field1 = "x" and field2 = "y"
For such a headache, I suggest to use a custom dialog box to enter all 3 values in the same window,, using global temp fields. Yr control script will check values, and then issue a msg telling what's wrong and offering to loop or escape, leaving data unchanged, or setting the corresponding field from the temp ones.
ASKER
I dont want to use a dialog box because most of these fields are from selections. I have a activation process that will check whats filled out. I normally put the validations in there, but I thought there might be an easier way.
true, this dialog box is missing check boxes and popups...
could you use a plug-in which executes a script whenever a given field is modified? (softs4humans event plug-in)
could you use a plug-in which executes a script whenever a given field is modified? (softs4humans event plug-in)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats it exactly!
Short answer:
if ( if field1 = "x" and field2 = "y"; not IsEmpty(field3); 1 )
Longer answer:
If you really want to strictly enforce validation, you need to take into account the user possibly changing the fields in a different order, as the validation only runs when the field changes. So you might want to add validations to the other two fields as well, so that the user can't go back and change field1 to a "z" without getting an alert as well. Might be overkill, depending on your application.