4 Replies Latest reply on Sep 30, 2014 12:23 PM by JP_2

    How to disable button action in filemaker pro 10

    Murugan

      Title

      How to disable button action in filemaker pro 10

      Post

      Hi guys,

       

                      In my layout have one button  name is  button1.

       when i click button want to  disable..  but now i am using conditionalformatting i have change button color same as layout background color.

       but when i move cursor hand symbol came and action also have.....

       

       So  how can i disable button script action also ?

       

       Is there any way to disable  button ?

        • 1. Re: How to disable button action in filemaker pro 10
          raybaudi
            

          Hi

           

          do a search for "Visibility Trick" on this Forum or on the Web.

          • 2. Re: How to disable button action in filemaker pro 10
            david_lalonde@d-cogit.ca
              

            There are two ways of disabling buttons.

             

            The first is to hide the button completely. The only way to do this in FileMaker Pro is to place the button in a portal whose relationship is controled by some field, typically a global, or to place the button on a tab control and set the tab control to another tab to hide. Both these techniques require scripting to work and likely will require script triggers.

             

            The second is to give the button a different colour scheme through conditional formatting so that users understand the button's functionality is not available. This is similar to what you have done, only your should not hide the button completely. To complete this approach, the script the button triggers also needs to look for the conditional formatting's trigger so that it knows to abort instead of performing its code. This most often take the form of an If statement skipping the entire code.

             

            Hope this helps! 

            • 3. Re: How to disable button action in filemaker pro 10
              philmodjunk
                

              There's a trick I use that's a variation on the conditional formatting technique.

               

              Instead of hiding the button, I just disable it. I use conditional formatting to change the button's text color to grey. Then I modify the button's script so that the first script step uses an If statment and the same condition so that nothing happens if the button is clicked. I also put any tool tip text inside an If function that makes the same test so any tool tip does not pop-up if the button is in its "disabled" state.

               

              Yeah, still get the hand and the button still highlights when clicked--both details I'd like to disable, but less of an issue since the button remains visible.

              • 4. Re: How to disable button action in filemaker pro 10
                JP_2

                I call this nifty trick "the rubber button." This allows you to grant conditional access to a button based on the user's privilege set.The button script will check user's privilege set name. If this priv set of the current user is not authorized to use that button, then the script will bounce them out of the button and into a field. Example:

                Button script: If (get current privilege set name) = "NotAllowedGroup1"

                Go to Field1

                Show custom dialog: "You do not have access to this button."

                Exit Script

                Execute actual button script (i.e. the "Open Employee Table" button will take the authorized user to the Employee Table).