Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7488 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I would like to perform record validation when the user commits a record. For example, if the value of a boolean field = True, I would like to ensure that another field in the same record is empty. How do I do this?

Posted

You could use this validation, James, attached to your second field:

IsEmpty(SecondField) and Boolean > 0 or Boolean < 1

Unclick 'Validate Only if Field has been Modified' in the calculation box. Oh. I know there are prettier, more clever ways. I just can't think of them. wink.gif

LaRetta

Posted

No, you were absolutely correct. I'm new to FileMaker and I just didn't understand your approach. Thanks for your attached file. It quickly cleared everything up. Actually, I wanted to ensure that the second field is empty if the boolean field is equal to "Yes" and not empty if the boolean field is equal to "No". Following your example, here is the calculation that acheives this when used as validation for the second field:

IsEmpty(secondfield) and boolean = "Yes" or not IsEmpty(secondfield) and boolean = "No"

Thanks very much.

Posted

Hi James,

I wondered what would be the criteria if the boolean was false - whether you would allow it to remain blank. And FM7 does not treat Yes/No, True/False, T/F, or Y/N as booleans like prior versions did. I thought you meant 'real' booleans.

Regardless, I'm pleased you have it working for you now. smile.gif

LaRetta

Posted

This is where xor comes in handy, too.

IsEmpty(secondfield) xor boolean = "No"

XOR ensures only one statement can be true, but not both. So it implies the inverse.

This topic is 7488 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.