In FileMaker, how can I prevent a field from being changed after data is entered?

82 Views Asked by At

I have a layout, call it ExperimentsLayout, based on my database table Experiment, which is related to table Scientist via foreign key relationship: Scientist.Id -> Experiment.ScientistId.

Users of my database (scientists) are still somewhat new to FileMaker, and I expect a relatively steady influx of FileMaker novices in the future, so I want to design in a way that minimizes the likelihood of user errors that could compromise data integrity.

In my layout ExperimentsLayout, I have a drop-down list box for Experiment.ScientistId. Once the ScientistId has been entered, I would like to either:

  1. totally prevent it from being changed, or
  2. throw a confirmation popup, to make sure this change is intended
  3. in some other way prevent the Experiment -> Scientist relationship from being unintentionally changed

When a user is browsing an ExperimentsLayout, I'm finding that sometimes they are changing the ScientistId in Browse mode instead of Find Mode, thinking that this is how to pull up the order(s) associated with the other scientist--but what they're actually doing is changing the scientist that the Experiment record is related to. As a relatively new user to FileMaker myself, I totally understand why users would make this mistake, since the UX distinction between Browse and Find mode is very (shockingly, to me) understated. This is a ticking timebomb for science data integrity problems.

1

There are 1 best solutions below

7
Schwarz Software On

If you are happy to handle it on the layout then the easiest and most flexible way to handle it is to add a script trigger to the field for "On Obect Enter".

  • Go to layout mode
  • Right click on the field and select "Set Script Triggers..."
  • Select "OnObjectEnter"

You can use the script to exit the field or show a confirmation box etc. Script Trigger

Alternatively

  • You could add a button to the layout with "Go to field[]" in the script and handle the logic in the button. The field also needs to be placed on the layout. Be sure that the user can't navigate into the field, e.g. by pressing "tab". Remove the ability to edit the field by going to the inspector and turning off "Browse Mode" and/or "Find Mode" in the field entry options.
  • There are other options, e.g. put the field in a popover and add a script trigger to the popover. The new window could be a smaller "card" window that will appear over the top of the base window.