4 Replies Latest reply on Mar 9, 2015 8:28 PM by philmodjunk

    Stuck on modifying fields on List view to filter etc



      Stuck on modifying fields on List view to filter etc


      Hi everyone, here's what I'm trying to do. Under List view under Accounts I have the body set to basically be horizontal and slim, just showing name, address etc, so that when I'm in List view it lists all my accounts as expected.  In the header, I have buttons like Show All, Filter to Mine only, Filter to this or that etc.  Where I'm confused though is there has been a few times now where I've wanted something to appear or not appear in the header, but I think those details are tied to actual records.

      For example, I have a button called Filter which is always visible.  Clicking it enters find mode.  I then need a way to execute that find as you can't just press Enter on WebDirect like in the FM application.  So what I thought was adding a button called Execute that only appears when in find mode.  I made a custom field called "ExecuteButtonVisible" and set it to be hidden if set to 1, visible if 0, then when clicking Filter, the script changes that field to 0 to show the execute button.  This doesn't work, and I'm guessing it is because that 1 or 0 field is actually on each account and not some master level.  So then I thought maybe a variable, and saw $$ makes it global, so I set it to make $$executebuttonvisible to 0 when entering that layout, and then when pressing the filter button the script sets variable $$executebuttonvisible to 0 and then enters find mode, but no dice here either it never appears.

      Just wondering what the proper method is for doing global things in the header of a list view like that.  Hope that makes sense!

        • 1. Re: Stuck on modifying fields on List view to filter etc

          A simpler way to script this might be to have the user enter or select search criteria in a set of global fields before performing a script that uses that data to perform the find. This can be a simple as a drop down list in the header where selecting a value from the list trips a script trigger to perform a script that uses the selected value as search criteria or it can be a button that pops up a dialog type window or a popover that opens with these fields for specfiying search criteria.

          For examples of scripted finds that you might use with such a technique, see: Scripted Find Examples

          • 2. Re: Stuck on modifying fields on List view to filter etc

            The only problem with that (I've come across that thread before) is it says you have to use Global Fields but that never seems to work for me.  These are customer accounts, so the fields we want to search are things like Owner, City, State, Status etc.  When I make any of those a global field, it says all fields must have the same data, and then it clears them all.  If I make a new account and put "Florida" for example under state, when I go to another record, it now shows Florida also, so I was never able to make that work.

            I mostly have it working okay now but as a side question or part of the first, is it possible to have a button change once pressed?  Like I have a Find button, when I press it it goes into Enter find mode.  I'm not sure how to then execute the find without the tool bar visible.  Ideally would prefer not to have a dedicated "Perform find" button always visible, so just wondering if that's even possible since I'm trying to not use the FileMaker tool bar and replicate what it shows on my own.

            • 3. Re: Stuck on modifying fields on List view to filter etc

              I believe Phil was suggesting that you create new global fields to be used expressly for your searches. Otherwise, as you've discovered, making one of your existing fields global will indeed produce the result you're seeing.

              • 4. Re: Stuck on modifying fields on List view to filter etc

                Rick is correct and this is why those examples have not worked for you.

                In those examples, you find a set field step like this:

                Set Field [yourtable::field1 ; yourTable::gfield2 ]

                field1 would be your existing field and it cannot be global. gField2, on the other hand, must be global.