6 Replies Latest reply on Dec 28, 2013 2:19 PM by philmodjunk

    Button View based on Users

    Annette

      Title

      Button View based on Users

      Post

           I was just wondering if it was possible to do the following:

           Say on a layout you have buttons, we'll say like this:

           Button 1

           Button 2

           Button 3

           And when a user goes to that layout they may only have permission to access button 1 and button 3 so the layout shows it as:

           Button 1

           Button 3

           As far as they are concerned there is no button 2, and ect. for other combinations.  Is this possible?  

        • 1. Re: Button View based on Users
          gcatnine

               With FM 12 you can use conditional formatting setting the fill colour to transparent

               with FM 13 there is a specific setting with inspector to set an object (button) invisible

                

          • 2. Re: Button View based on Users
            philmodjunk

                 This will leave a gap between buttons 1 and 3. You may want to use conditional formatting to "grey out" the label text. So such a gap does not appear. And for versions 12 and newer where you use conditional formatting to change the appearance or visibility of the button, this does not keep the button from being clicked and the script performed. You'll need to include an if step in the script in those cases that keeps the button click from doing anything should an unauthorized user accidentally click the invisible or hidden button.

                 There are other ways to hide a layout object from view if you are not using FileMaker 13 that will also keep the button from being "clickable".

            • 3. Re: Button View based on Users
              RickWhitelaw

                   That's true, but even though transparent or invisible, I believe the button can still be clicked.

              • 4. Re: Button View based on Users
                Annette

                     Yes, while I love the feature on 13 that allows you to hide an object, it does leave the space where the hidden objects were and I was trying to find a way so that if say someone didn't have access to button 2 it didn't show it and moved the buttons under it up.  I'm not sure how greying out removes the gap of where button 2 was.

                • 5. Re: Button View based on Users
                  Kitchenscapes

                       Using FM11PRO

                       Using a global field as a button allows you to change the button label in one location that will show up everywhere that field(button) exists.

                       If you use a script trigger to capture what the field(button) contains, you can process whatever it is you want to accomplish. For instance I've used it to navigate to a layout, if button(field) says "Contract", it will navigate to the layout named "Contract". What you can do is make button 3 conditionally invisible, as Phil said you need to add an if statement to make it inactive, then change the button 2 (field2) to button 3's value. If your buttons are not navigation buttons, you can still capture the content and process a script. If button3 is the "Print" button and then on a particular layout it becomes button2, it might become confusing.  If your solution becomes large it is better if things are where users expect them to be.

                  • 6. Re: Button View based on Users
                    philmodjunk

                         Some "pre 13" method for hiding objects such as using a portal or an invisible tab control also create a situation where the button is both invisible and cannot be clicked.