4 Replies Latest reply on Aug 7, 2015 8:05 AM by JimZ

    Scripting question

    JimZ

      Title

      Scripting question

      Post

      I am trying to see if it is possible to script a program that will do the following.

      1. View each field in a layout one at a time and determine if it is empty.

      2. If the field is hidden then move onto the next field.

      3 If field is not hidden then I will write in a prompt that will say which field is empty and needs information.

       

      my question is on step 2. Is there a script command or some series of commands that could tell if the active field is hidden or not? any thoughts or advice on this would be super awesome.

       

      PS: Currently using a crazy ifception to accomplish something like this but would like to find an easier way.

        • 1. Re: Scripting question
          philmodjunk

          Hidden and Empty are not the same thing. I will assume that you mean empty, not "hidden".

          IsEmpty ( Get ( ActiveFieldContents ) )

          would seem to be the test that you are looking for here.

          • 2. Re: Scripting question
            JimZ

            I mean both. Sorry my original post must be a little confusing. I have a layout that has a bunch of fields that will hide/unhide upon what a certain field (or fields) contains. I am trying to make a more efficient script to require that all visible fields must contain some sort of import. I want to make it so if the field is empty and visible it pops up a prompt saying you must enter a value into [Blank] field. But than if it is also empty but hidden I want it to skip over it. So I am wondering if there are any script or calculations that can look at an active field and determine if its visible or not.

             

            • 3. Re: Scripting question
              philmodjunk

              The only way to hide a field is to specify a Hide Object When Expression. So your check would need to use the same expression to check to see if the object is currently visible.

              • 4. Re: Scripting question
                JimZ

                Ok thank you. At least I know now that the way I am doing it is the only way it can be done. Be cool to see FileMaker add scripts that can see if fields are hidden or not and can hide fields through the script.