2 Replies Latest reply on Feb 14, 2010 12:42 PM by Jade

    How to script so that a field cannot be left empty?

    LeoB

      Title

      How to script so that a field cannot be left empty?

      Post

      Two fields in one table:  Status and DateClosed

       

      I wrote a simple script that says if the Status changes to Closed, then a pop-up appears and says that a DateClosed must be entered.  On clicking OK, it takes the user to DateClosed.

       

      However, I'm trying to figure out how to freeze the user in the DateClosed field until a date (drop-down calendar) is entered.

       

      How can this be done?

       

      Thanks

       

       

        • 1. Re: How to script so that a field cannot be left empty?
          Steve Wright
            

          What version of filemaker are you using ?

          In FM10, you could use onObjectExit script trigger to achieve this

          • 2. Re: How to script so that a field cannot be left empty?
            Jade
              

            Hi Leo,

             

            …or you can try this:

             

            Edit the DateClosed field and check the Validate by calculation checkbox in the Validation tab.  Specify the following calculation to Validate the field "DateClosed":

             

            (Status = "Closed" and not IsEmpty(DateClosed)) or (Status ≠ "Closed")

             

            Then uncheck "Validate only if field has been modified" at the bottom of the calculation area as well as the "Allow user to override during data entry" on the Validation dialog.

             

            Optionally check "Dispaly custom message if validation fails" and enter your custom warning.  

             

            The warning is not displayed until the user tries to commit the changes to the record at which time, the user is given the option to:

            • revert the record to its original state;

            or 

            • click "OK" and have the cursor returned to the DateClosed field.