James McIlwrath Posted May 22, 2004 Posted May 22, 2004 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?
LaRetta Posted May 22, 2004 Posted May 22, 2004 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. LaRetta
LaRetta Posted May 22, 2004 Posted May 22, 2004 Something is askew then. Attached is my file. boolean.zip
James McIlwrath Posted May 22, 2004 Author Posted May 22, 2004 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.
LaRetta Posted May 22, 2004 Posted May 22, 2004 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. LaRetta
-Queue- Posted May 22, 2004 Posted May 22, 2004 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.
Recommended Posts
This topic is 7751 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 accountSign in
Already have an account? Sign in here.
Sign In Now