4 Replies Latest reply on Feb 3, 2012 9:19 AM by willrollo

    Hiding object

      Title

      Hiding object

      Post

      Hi I have tried this before and given up. Used a solution on the forum posted a whike back using getwindow mode and global fields and contianers etc but to no avail. I would like a solution that doesnt mean duplicating layouts!

      All i would like to do is for the "Order" button to disappear (if possible) or at the very least cease to function/lock out if the "order" button is pressed. The script at the moment when this button is pressed, creates a job number, a date of job, a custom dialogue and also changes the "status" field to "Order". The other button "invoice' can then be pressed - this locks the invoice due to privelage sets.

       

      In a way, I would like the 'invoice' button to appear instead of the order button, once "order' is pressed. Does this make any sense?

       

      Thank you

      PS attached a small grab to show part of layout I have at the moment...

      2012-02-03_04.39.32_pm.png

        • 1. Re: Hiding object
          philmodjunk

          What data in the current record or a global field/variable determines that this button should be disabled or disappear?

          Let's say a field, yourTable::Field is set to "DisableOrder" if the button is to be disabled.

          You can set a conditional format on the button

          YourTable::Field = "DisableOrder"

          and specify a grey text color to give the button a disabled "look".

          Then you can put the button's script inside an If block so that nothing happens if the button is to be "disabled":

          If [YourTable::Field ≠ "DisableOrder" ]
            #put all script steps here
          End If

          The only negative to this method is that the button still highlights when you click it.

          You can make the button disappear through several methods:

          1. If you used text objects instead of the graphic objects that you have here, a conditional format can make the button disappear completely by specifying a font size of 500.
          2. If you put the button inside a one row portal, (portal borders can be invisible), a change in a value used in the relationship to the portal table or a portal filter can control whether or not a related record exists in the portal. If there's a related record in the portal, the button is visible. If it is not, it's not visible.
          3. If you put an invisble two panel tab control on your layout, (Make panel borders transparent or zero width. Make fill color match background. Make the panel labels zero width ), you can give each panel an object name. Then a script, controlled by the appropriate script triggers, can use go to object to select a tab panel. Select the Panel with a button and it appears, select the panel with out the button and it disappears.
          • 2. Re: Hiding object

            Hi Phil

            Thank you for such a speedy response! The answer to your first question is When the user clicks  on the Button labelled 'Order' I want a script to run - in this script ideally I would like:

            THe "order' button to disappear/lock

             

            or to be replaced with the invoivce button ( in this case I would remove the invoice button as wouldnt want two invoice buttons).

            Basically, an order has to be created before it can be converted to an invoice. The "make order from button' Script that I have on the order button does specify the "Staus' field to display "order"

            Hope this clears things up. But looking over your first repsonse seems that you may have provided the answer..unless you can suggest anything else..?

            Thank you again

            • 3. Re: Hiding object
              philmodjunk

              Your script can set a field or global variable to a value that makes the appearance of the button change or make it disappear. This same basic script step will make any of the methods possible.

              You can also include a text field or global variable (FileMaker 11 only) as part of your button and then change the text from order to invoice and vice versa. The script would then check the text in this field to determine what happens when the button is clicked.

              • 4. Re: Hiding object

                Many thanks

                I will test all that out tomorrow!

                Thanks Again Phil...