Hi!
I have a form that I want people to fill out and summit but I have notice that some fields are left empty. How can I make each field is required before going next field.
More info please: is there an actual "submit" process, or is it just a data entry screen that your users can walk away from leaving a half-completed record in the system?
There are several methods of preventing incomplete records with empty fields:
a) Put a validation formula on one of your fields: not IsEmpty (Field A) and not IsEmpty (Field B) and not IsEmpty (Field C) (etc...). This will generate an error message if the user tries to commit the record before all fields are filled out.
I personally don't like this method because people may hit the enter key or click out into the space between fields, thus committing the record, when they are not finished with their data entry process, and when they didn't consider themselves done; FileMaker lets you specify the error message but it doesn't let you make the error message condition, so you have to write something like "You left one of the following fields blank: Field A, Field B, Field C, Field D. Field E....{etc}." And the error message has confusing buttons, "OK" which leaves the cursor in the last field it was in (not one of the empty ones) and "Revert Record" which undoes all of their data entry work and would make them start over, without explaining that that's what they've chosen to do. But it does work and doesn't require a lot of additional architecture.
b) Have your users do all their data entry into global fields. Then at the bottom of the data entry form, have a SUBMIT button that runs a script that makes a new record in the relevant table and populates the fields with the values from the global fields. As your first step in the script, you can check for non-empty values in all the global fields and throw a much more specific error message: "The following fields are empty and are required before your form can be submitted: Field C; Field F" / OK". and then exit script and let them finish and resubmit.
c) Use a script trigger OnRecordCommit and let your users type directly into the record (not global fields); the script does the same kind of checking and error messaging, and can do a Revert Record if the user cancels the submission.
d) Have your users do all their data entry into nonglobal fields in a separate, mirror-image Data Entry table. Unlike the other solutions, this would let your end users log back in tomorrow or next week and find their half-completed data entry page and fill in the missing fields and THEN submit. The script checks for completed records and if all required fields are non-empty, creates a record in the main (real) table, links it to the Data Entry record (relationship, DataEntryKey = Data Entry::Serial Number) and runs a string of Set Field commands to populate the real record with the equivalent field values from DataEntry.
Your new post is loading...