5 Replies Latest reply on Mar 25, 2013 10:00 AM by LaRetta

    Script Trigger or Permissions?

    nmorales

      I would like to restrict the user from exiting a record unless they have selected a DJ when in a certain sales page. I dont see any script triggers for exiting records. Is there any other way I can have this checked? Can I perhaps have that field be a required field?

        • 1. Re: Script Trigger or Permissions?
          mikebeargie

          The script trigger you are looking for is in layout script triggers, not field script triggers.

           

          Layouts Menu > Layout Setup > Script Triggers Tab > OnRecordCommit

           

          Here's some more details on that trigger:

          http://www.filemaker.com/help/html/script_trigg.38.8.html

           

          You would then tie a script to that trigger to do your validation.

          • 2. Re: Script Trigger or Permissions?
            debi

            nmorales,

             

            Yes, you could make it a required field. In the field definition (File > Manage > Database... > Fields tab), use the Options button, navigate to the Validation tab, and set the field to be "Not Empty."

             

            Debi Rubel

            FullCity Consulting

            • 3. Re: Script Trigger or Permissions?
              Lemmtech

              Yes triggers or validation but validation happens everywhere the field is where as triggers you can make layout specific.

              • 4. Re: Script Trigger or Permissions?
                BobGossom

                Hi,

                 

                My preference is for both triggers and validations. I find the user interface for validations pretty obscure - limiting dialogs as to why, dialogs after they have exited the field, and so forth. But as you point out, they are system wide, and therefore much more secure. So I often use validations, but also put script triggers in (generally on exit field, or modify field) that <almost> always kick in before the field level validation. The triggers let me control the user enviroment, and the validations protect the data.

                 

                Bob Gossom

                • 5. Re: Script Trigger or Permissions?

                  Bob Gossom said, "So I often use validations, but also put script triggers in (generally on exit field, or modify field) that <almost> always kick in before the field level validation. "

                   

                  OnObjectValidation's purpose is just this, Bob.  I've been using it more often as well.  Triggers can be fun but also tricky and I completely agree!  I've debugged some systems ( and sometimes mine <bush> ) where triggers loop and trip over each other sometimes producing incorrect results; sometimes only *annoying the User with repeated message or erratic cursor/field acrobatics.

                   

                  * User annoyance is too high a cost