3 Replies Latest reply on Sep 10, 2013 7:17 AM by DavidCorrigan

    Field Validation - Field # not empty when Field 1 contains text

    DavidCorrigan

      Title

      Field Validation - Field # not empty when Field 1 contains text

      Post

           Hello all

           I am new to Filemaker so the community's help would be much appreciated.

           I am sure that there is a very simple answer to this question but my attempts have failed miserably!

           I have a section in my database with four fields. The first field is used to describe a corrective action that is required in a process, the second field describes who the action is assigned to, the third field allows a date that the action must be completed by to be selected and the fourth field allows YES or NO (from a drop down menu) to be selected to indicate if the corrective action has been completed.

           The validation I am trying to set is that fields 2,3 and 4 must contain data when field 1 contains a corrective action.

           I would also like to display an error message to state which field must be corrected so I expect that I need a validation calculation to be entered into the options of fields 2, 3 and 4 but I cannot determine the correct calculation to use.

           Many thanks for any help that you can offer on this matter.

           Dave

        • 1. Re: Field Validation - Field # not empty when Field 1 contains text
          ninja

               You would set up the field validation by calculation:

               Field 2 validation is: If( not IsEmtpy (Field1) ) with a message on validation fail of "Corrective Action must have a Champion" or some such.

               If it is certain text you are looking for, it might instead be If(Field1 = "Corrective Action" ; 0 ; 1)

               Similar validations would be set for Fields 3&4.

               What I would do is launch a script trigger OnModify for Field 1 that pops up a dialog box asking for values of the other fields if Feild1 has a corrective action demand.  This would help to avoid the annoying "Validation Fail" error messages.

               PS, it's early...I might have the Booleans backwards.

          • 2. Re: Field Validation - Field # not empty when Field 1 contains text
            philmodjunk

                 IsEmpty ( Field1 ) or Not IsEmpty (Self )

                 Is a validation calculation that can be set in field options on fields 2, 3, and 4.

                 But validation rule violations have just one message that tells the user that something failed a validation. There's no capability to have different messages for each of fields 2, 3, and 4.

                 To do that, you'd need to write a script and perform that script with the OnObjectValidation trigger.

            • 3. Re: Field Validation - Field # not empty when Field 1 contains text
              DavidCorrigan

                   Thanks to both of you for your responses. I have used PhilModJunk's calculation and the database is now correctly performing the validation query's I required when a corrective action is specified in field 1. ( A person' name, a completion date and a YES/NO option all need to be set)

                   Cheers