5 Replies Latest reply on Jul 8, 2015 2:15 PM by lijnbach

    Active button doesn't return in inactive after exit script

    lijnbach

      Summary

      Active button doesn't return in inactive after exit script

      Product

      FileMaker Pro

      Version

      14.01

      Operating system version

      OSX Yosemite 10.10.4

      Description of the issue

      In the new FMPA 14 the developer can make "menus".

      Within the new menus you can give the active button another color or view than the inactive buttons.

      In my case I have a script, that when the user is adding a new record (Get (RecordOpenState = 1)),and the user is clicking a menu button while adding a new entry, the user gets a dialog box, and directly after that an "exit script". (So the user is forced to stay on the LayOut and finish the new entry, or exit the new entry, before going to another LayOut).

      All works fine, except the "active button" is already active, so the menu bar doesn't show the right view (or color) anymore after exit script. (Because the other button is already active, also after "exit script", where the user is forced to stay on the LayOut with his/her new entry).

      Hans Lijnbach

      Expected result

      Not changing the view after "exit script"

      Actual result

      Meu bar "active button" is already changed after "Exit script".

      Workaround

      Not found yet

        • 1. Re: Active button doesn't return in inactive after exit script
          TSGal

          Hans Lijnbach:

          Thank you for your post.

          I'm a little confused what you are trying to accomplish.

          The Button Bar is designed for layout navigation, or works with Slide Control to mimic tab control, so the active button/segment will always show which layout or slide is in front.

          Are you trying to deactivate the active button?  That is, after the script runs, do you want the active button to return to an inactive state?  If so, then use a calculation to point to the Button Bar when specifying the active segment.  For example, in the Button Bar Setup, under "Active Segment", click "Specify...", and set the calculation to Random.  Then, in your script, have the last statement "Refresh Object", and specify an object name for the Button Bar.

          Is this what you want?

          TSGal
          FileMaker, Inc.

          • 2. Re: Active button doesn't return in inactive after exit script
            lijnbach

            Sorry TSGal,

            It has to do with the language, English is not my native language.

            What happens is this:

            I have a LayOut and above the layout there is a menu bar with 5 menu buttons. One button is the active button (for the LayOut the user is working on). The active button, for the LayOut the user is working on, has another view (color) and is set to active in settings. (The active button has no script, because the user is already on the appropriate LayOut). It is also possible to hide the active button automatically, but that makes it less transparant for my users. (Teachers, and they don't like ICT)

            All works fine. But now the user is adding a new record, and accidentally (or not) pushes one of the other menu buttons. I have a script to prevent them to go to another LayOut when OpenRecordState = 1. Also works fine. But, once they pushed another button of the menu bar, this other button becomes the active button with another view (color). In my script I have an Exit script step and the user stays on the active LayOut until the adding job is finished or cancelled. Also works fine.

            Only, the other button the user pushed accidentally, is becoming the active button. And I want the original active button to stay active until the user is really on another LayOut. (Otherwise it is getting very confusing for the users).

            Perhaps this explanation helps.

            (I included a picture of the menu).

            Hans Lijnbach

            • 3. Re: Active button doesn't return in inactive after exit script
              lijnbach

              TSGal.

              PS. Yes, I want the active button is always the button for the LayOut the user is working on.

              If I use a calculation to set the active button, it doesn't seem to work. If I use e.g. active button by calculation - Get (LayOutName) or Get (TabelName) - nothing seems to happen. Now the active button is set manually, but changes as soon a user clicks another button, even when I exit the scrip and force the user to stay on the LayOut.

              Hans Lijnbach.

              • 4. Re: Active button doesn't return in inactive after exit script
                TSGal

                Hans Lijnbach:

                Thank you for the explanation.

                1. Create another text field that will be hidden from view.  For now, name it "TEST" (you can rename it later), and temporarily place it on the layout.

                2. In the Button Bar Setup, next to Active Segment:, click Specify...  Here, you will enter a calculation:    TEST
                   This means the Active Segment will become whatever is the content of the hidden field.

                3. Go to Browse mode, and enter into TEST one of the names of the segments.  For example "Leergroepen".  Refresh the screen.  You will see that "Leergroepen" is now the active segment/button.

                Now, in your calculations, you can use Set Field ( TEST ; <value> ).  That is, if the correct conditions are passed, then you can update TEST.  In your example, if Get (RecordOpenState) = 1, then you will want to set TEST to the default value, and then Refresh Object <button bar name>.

                Let me know if you need additional clarification.

                TSGal
                FileMaker, Inc.

                • 5. Re: Active button doesn't return in inactive after exit script
                  lijnbach

                  TSGal,

                  Thanks for your clarification. I understand now how it works. I suspected it to behave totally different. In the calculation for the active segment, I assumed it would be based on the table name, the LayOut name or something else.

                  (Time for a manual in the Netherlands).

                  Thanks for your effort and time.

                  Hans Lijnbach.