3 Replies Latest reply on Apr 25, 2012 1:57 PM by philmodjunk

    Gray out Option

    JosahMower

      Title

      Gray out Option

      Post

      I have a Form (Req-Form) that I create that does not auto save, the user must click a save or cancel button to keep the tables clean.
      On the same form I have come to the conclusion that for my misc Notes field I want to create a new table to house the notes because there could be multiple notes for the one record and I can have subjects to know what the notes are about. But when you click the add note button it takes you to a new form (Req-Form-Notes) just for the notes. I take the index from (Req-Form) and use a variable to copy and paste the Req-Form index into the notes field.

      Now the problem is if the Req-Form is not saved to create the auto-serial number index, I get an error on the Req-Form-Note page and cant link the note to the Req. I would like to Gray out the option for add note till I have saved and created an auto-serial for the Req-Form. How would I do this.

       

      I have been googling but I am getting gray out from the filemaker program its self and not fields in forms.

        • 1. Re: Gray out Option
          TSGal

          Josah Mower:

          Thank you for your post.

          You will be unable to do this in FileMaker Go.  You will have to make changes to the database file in FileMaker Pro prior to moving it to Go.

          You can create a conditional calculation that displays the button in Gray when the Auto-serial number doesn't exist, and black when it does exist.  On top of that, set a script to the button that checks to see if the Auto-serial number exists.  If not, then exit the script.  Otherwise, it will take you to the new form.  Once this is working, then you can copy it to FileMaker Go, or have FileMaker Go access the file remotely.

          Let me know if you need additional clarification.

          TSGal
          FileMaker, Inc.

          • 2. Re: Gray out Option
            JosahMower

            Sorry I must have entered the wrong forum, I have Filemaker Pro 11. I was having a problem setting up a script to change the button colors after searching the table to see if the index was committed or not.

            How would I search the db for the index number and change the colors and option to enable the button?

            • 3. Re: Gray out Option
              philmodjunk

              Let's say your serial ID field is named __pk_REQID and this is a field of type Number.

              a Conditional format expression: Not YourTable::__pk_REQID can be used to change the text and/or fill color of your button to show it as disabled.

              The script performed by this button can be enclosed in an If block that checks this same field for a value:

              If [Not YourTable::__pk_REQID]

                #your script here

              End If

              The button is not really disabled, it'll change color when you click it, but nothing will happen when you do unless the serial number field has a value.