4 Replies Latest reply on Aug 26, 2014 11:00 AM by philmodjunk

    Hiding Button Conditionally

    ChadBarnard

      Title

      Hiding Button Conditionally

      Post

           I have a button that opens up a folder on the server.  The button setup is this:

                     "w:/"&Orders::JobNumber&""

           So, it basically pulls up the folder associated w/ that job number.  That works fine.

           What I'm trying to do is hide the button if no folder w/ that job number exists.

           I thought that I could do a simple "Hide object when" w/ :

                    not (IsValid ( "w:/"&Orders::JobNumber&"" ))

           but that doesn't work.  Weirdly enough, if I do the following:

                     IsValid ( "w:/"&Orders::JobNumber&"" )

           The button disappears on every record (those that have an associated folder and those that don't).

           Any ideas?

           Thanks

        • 1. Re: Hiding Button Conditionally
          philmodjunk

               An empty field's value IS valid and thus that function won't work.

               But there's a function called IsEmpty() that you can use:

               IsEmpty ( Orders::JobNumber )

               Should do the trick unless you need to check and see if the folder named in the JobNumber field exists. That's not something FileMaker can really do without the help of a plug in unless you use a folder located inside the local computer's document folder. (You could try saving or exporting a file to that location and the error message that interrupts your script would tell you, but that's hardly the way to hide this button....)

          • 2. Re: Hiding Button Conditionally
            ChadBarnard

                 Yeah, unfortunately, I'm trying to do the latter.  I wanted to check if the folder existing on the server, and if it did, then show the icon.

                 Even if you have to buy it, is there a good site for plug-ins, or at least somewhere I can do some research.

                 Thanks for your help.

            • 3. Re: Hiding Button Conditionally
              philmodjunk

                   A web search for "FileMaker Plug IN" should pull up a number of Hits. A plug in that can list the contents of a file folder has been created by several different parties. One that I recall by MooPlug is a windows only but free plug in. Troi is the name of another well known long established source of plug ins that includes a plug in for file manipulation.

              • 4. Re: Hiding Button Conditionally
                philmodjunk

                     Grumble at FileMaker: If I could use Set Error Capture to supress the error dialog that pops up when Export Records tries to create a record and fails, I could do this pretty much all in FilMaker (except for maybe a system script to delete the record created when Export Records succeeds in creating the file...)

                     System Scripts, BTW, are the other way that you can do this. A system script (system scripts are dependent on your operating system as to which you can use) can generate a text file listing a folder's contents and this text file can then be imported into FileMaker in order for a script to then check against that list to see if a file or folder exists in that list.