June 3, 200223 yr Hi all! I am trying to define a calculation as a field validation and am stuck. What I want to do is disallow certain values in a field when a certain pattern exists in a related field. Specifically, I want to disallow the number 88164 in a text field(Code) when the pattern "thin" appears in a related text field(Related::Text). I tried using the following calc: If(Code = 88164, PatternCount(Related::Text, "thin") = 0, 0) This may sound stupid, but it worked briefly and then it stopped working. It now keeps failing validation. Here's another twist. I actually need to validate the Code field for two values. Specifically, I want to disallow the number 88164 in the text field(Code) when the pattern "thin" appears in the related text field(Related::Text) and I want to disallow the number 88142 in the text field(Code) when the pattern "conventional" appears in the related text field(Related::Text). Anyone know how this can be done using validation?
June 3, 200223 yr Wow. thats a mouthful... Your on the right track with the validation. The only advise I have if it stops working is 2 things: -Double check the relations. Make sure everything is in order. Somthing could be messed. -Validations are evil buggers. Make sure you're not fooling around with the validation calc when you're in the field itself. FileMaker doesn't check until after you try and leave the field. As well, if your using a custom fail message, FileMaker shows that for ALL failed validation, ie non unique, not in value list etc.... If the message box does not have the 'Revert Field' button it is somthing else failing.
June 3, 200223 yr Author Thanks for you response! I am in fact using a custom message, but every time it fails the "Revert Field" button is available. I am wondering if it has to do with the fact that the calculation has the field (Code) that is being validated in it. Any thoughts?
Create an account or sign in to comment