Jump to content

Making a field manditory

This topic is 6536 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hey Simon ...

I'm responding to this bit in your post: "before the record is saved."

You can enforce validations on fields in the record so the user cannot leave the record until these requirements are met. But in FileMaker, as soon as the "New Record" command is called, the record is part of the database.

One way around this is to tightly script the creation of new records. Instead of immediately creating a new record, the user is taken to a layout consisting of only Global fields. From the user's perspective, data entry proceeds as ususal. After entering data into the Global fields, the user clicks an "OK" or "Enter" button, and a script is run that checks for whatever validation criteria you want to enforce. If all criteria are satisfied, a new record is created and the user's entries are inserted into the actual data fields. If the user has entered data that doesn't meet validation requirements, they're shown a message with information about which fields need fixing. The key thing here is that a new record is not created until the user has entered data meeting the validation criteria.

Especially in situations where users are creating related records from the "Parent" record (e.g., invoice Line Items), this is my preferred method of making sure that all records contain valid data. I never, e.g., allow data entry directly into portal fields.

Link to comment
Share on other sites

I agree with Jim's methods.

In my DBs, I mirror the fields in a record with globals, I use the globals for both record creation and editing, so the user can cancel after entering/editing without repercussion. My layouts have Cancel and Save buttons for familiarity. The Save button runs a script that validates.

I also auto-fill/auto-format fields to ease data entry for the user. As an example, let's use a person's initials. These are the fields: g.Initials.Entry, gc.Initials.Autofill, gc.Initials.NotValid. gc.Initials.NotValid checks the g.Initials.Entry field to ensure it contains letters, is 1-3 characters in length, etc., it returns 0 or 1. gc.Initials.Autofill is placed on the layout over g.Initials.Entry (ask if explanation is needed on how to make one field mask another). gc.Initials.Autofill returns blank if g.Initials.Entry is not empty and gc.Initials.NotValid is false. if gc.Initials.NotValid is true, it returns an errors string, like "?? Invalid Date". If g.Initials.Entry is empty it returns the first letter of the first, middle, & last names.

Probably more information that you needed to know....

Link to comment
Share on other sites

This topic is 6536 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.