Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Validation by Calculation

FMP 8 again

How do I set a "not empty" validation on field3 if field1 = "x" and field2 = "y"
0
Cruizectrl
Asked:
Cruizectrl
  • 2
  • 2
  • 2
1 Solution
 
billmercerCommented:
The field validation boils down to a boolean value, so you need a validation expression that evaluates to
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.


0
 
lesouefCommented:
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.
0
 
CruizectrlAuthor Commented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
lesouefCommented:
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)
0
 
billmercerCommented:
Here's a simple solution:

Put a validation calculation just on Field3, but uncheck the option that says "Validate only when field has been modified."
That will force validation to run whenever the record is accessed, which means it will kick in even if the user goes back and alters the values of field1 or field2. That will prevent user entering the correct values in 1, 2, and 3, but then going back later and changing 1 or 2 without changing 3.

http://www.milleniumhandandshrimp.com/upload/notempty.fp7

0
 
CruizectrlAuthor Commented:
Thats it exactly!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now