2 Replies Latest reply on Jul 12, 2017 8:09 AM by gofmp15

    Using DatabaseNames to highlight a record


      I've made a thousand different dashboards/menus to open FileMaker files ranging from complex tables with checkbox privileges, etc to this latest one where I am trying to keep it simple and sane.


      On the right is the simplest technique I've found. A container field is displayed on the layout. It is enabled for editing. The user can right click to change the file or double click to open it. This FileMaker technique is so simple I cry thinking about it. It even works for remote files and if you move them you can reattach them easily. No scripts, not tables and no...


      The layout on the left uses the same technique but instead stores the path name of the file in a field to be used as a variable in Open File. A few extra scripting steps. This one prevents accidental or deliberate changing of the file names.


      When a file is opened by clicking, a conditional sets the color to green (your choice) using Patterncount(databasenames;filename field)> 0. When the file is closed, the conditional returns the line to the default color. Almost...


      Works ok with a few problems the most irritating one being that when I close one of the files, the conditional doesn't update intermediately even if an unstored calculation is used to hold databasenames. Yes, I could employ some secret technique to pass parameters back to this file and make it update itself, but simple is the key word here.


      The essence of the problem is this: after a file is closed and I bring this window to the front, it doesn't update itself until I click on the layout or click another file. FileMaker lacks a trigger that activates when a window is made front most either by clicking on the window bar or by closing one on top of it. In my example, closing one of the windows highlighted should trigger this window if it is thus brought to the top or when it is brought to the top by selecting the window.


      While expressing a grumpy because the conditional doesn't update like I want, I must say that I am once again impressed by FileMaker. I created the navigational menu on the right with one container field and one conditional calculation. Double clicking on the editable container field opens the file.


      Oh, yes. Doesn't work with IOS using entries from Pro...  to do that a scripted button is needed with a known pathname which can be extracted from the container.

        • 1. Re: Using DatabaseNames to highlight a record

          Only an idea, that using variable for keeping value of databasenames function, it is maintained with onLastWindowClose (and firstWindowOpen) trigger. You can remove(add) database name from the list, then refresh window.

          1 of 1 people found this helpful
          • 2. Re: Using DatabaseNames to highlight a record

            Much simpler when using a conditional is this formula:


            PatternCount(DatabaseNames ; File Paths::File Name ) > 0


            Now the record is colored green whenever the file named in the record is open. Only problem is that FileMaker does not have a trigger for when the layout is brought to the front. Often I have to commit the record by clicking elsewhere to have the latest window shaded in green.


            As windows are opened and closed this trigger script does the work.