5 Replies Latest reply on Apr 17, 2009 3:20 PM by Jade

    making a validation button



      making a validation button


      Question is there a simple way to make a script that will validate several field to see if data has been entered?


      for example:


      If I wanted to make sure the fields: Name, Date, Phone, Email, Date Opened all had a value in them


      I know I need to set a capure error message and create a button


      thank you

        • 1. Re: making a validation button



          When you edit the fields (File>Manage>Database…), select the 'Validation' tab and check "Not Empty" and uncheck  "Allow user to override during data entry".  You can also define a custom message in the dialog box at the bottom that will display if the user forgets to enter some data in the field.

          • 2. Re: making a validation button

            Okay that works but si there a way that I can make it so they cannot enter anew record until those fields are entered? Also I have fields that I want them to fill in before closing a record which comes months later can I apply this to what we just discussed? can I make a button to run the check opening, check at closing?



            Thank you

            • 3. Re: making a validation button
                 Okay dont allow them to overwrite figured that out but what about for when closing the record and entering the final data?
              • 4. Re: making a validation button

                Now you need a script as the validation options will trigger as you exit fields and/or commit the record.


                How do you "close" the record? Do they click a button perhaps?


                You'll want to trigger a script at the time the user performs that operation.


                If [isempty(table::field1)]

                  Show Custom Dialog ["ERROR"; "Missing data in field1]

                  Exit Script []

                End If


                IF [isempty(table::field2)]

                  Show Custom Dialog ["ERROR"; "Missing data in field2]

                  Exit Script[]

                End If


                and so on.

                • 5. Re: making a validation button

                  My previous technique only works when adding or editing the current record and will not work well in the case where there are months before the fields are completed.


                  You may consider adding a 'status' field (perhaps a checkbox or radio button) to indicate that a record is either "open" or "closed".  Make this field a button and add a script to it that checks that the fields you mentioned are not empty (e.g. "not IsEmpty (yourField)" ).  When the user clicks on this status field to change it from "open" to "close" the script will then check the fields and either display an error message or set the field to "closed".  


                  Is that more in line with your requirements?