1 of 1 people found this helpful
Do these two things to fieldB under the field options in Manage Database:
- In the Auto-Enter tab, select "Calculated value", and specify the calculation: "If ( IsEmpty ( fieldA ) ; "" /* Null */ ; /* Else */ Self )". Back in the field options uncheck the "Do not replace existing value of field (if any)" checkbox. This will clear any value in fieldB if fieldA is empty.
- In the Validation tab, select "Validated by calculation", and use this calculation: "IsEmpty ( fieldA ) or ( not IsEmpty ( A ) and not IsEmpty ( Self ) )". This will make it a validation error for fieldA to be filled and fieldB to be empty. You should probably specify a custom message for validation failure to clarify the problem for users when they encounter it.
the 2nd solution is not working. I used this code
"IsEmpty ( fieldA ) or ( not IsEmpty ( A ) and not IsEmpty ( Self ) )"
and I followed the instructions
on the data entry when i commit it does nothing even if field A is filled
and thanks for the reply i can use any and all help in learning this software
Michael's validation calculation is simpler than mine, but the different calculation doesn't get to the heart of the issue you're finding. When you're setting the validation calculation, the calculation dialog has a checkbox at the bottom labeled "Validate only if field has been modified." When this is on, FileMaker wont try to validate fieldB unless you enter and try to exit the field. You need to un-check this, by the sounds of it.
thanks Michael and jbante both the solutions worked very well it cuts down a ton of script i had put in all sort of places.
I think I need to learn more about scripting. Coming from a Non IT background it all seems like greek to me. Is there any book and resources that you guys can recommend which may help.
Thanks a lot
THE must-have book for understanding script step options and calculation deciphering:
- FileMaker 12 Developer Reference, Que Publishing, August 2012.
- ISBN-10: 0-7898-4847-9
- ISBN-13: 978-0-7897-4847-8
With much thanks to the authors: Bob Bowers, Dawn Heady, Steve Lane, and Scott Love.