3 Replies Latest reply on Aug 10, 2012 1:06 PM by maser

    Can you save a "find request" as a variable?



      Can you save a "find request" as a variable?


      THis is probably a simple question, but I've not found (yet) how to do it...


      Using FIleMaker 12...


      I want to do a chart of some data (which is easy), by doing a find request in the "date" field (ie, 2010...2012) over a range of dates (but may also be a single date - which is also easy.)


      But, when I display the chart, I want the *title* of the chart -- to be the value of what I am doing the find request for the date range.  If it's a single date, that's obviously easy.   But what if it's a range of dates?


      Is there a way to store the value that's entered in a field for a find request into a variable and regurgitate that value somewhere else? 


      It would seem like that should be possible, but I'm not seeing the easy way to do that.

        • 1. Re: Can you save a "find request" as a variable?

          It's something that I'm jealous of in other applications.

          If the potential search criteria are limited: say a date range, customer name and product range; you could capture the criteria in global fields.  That is: ask the user to input the date range, customer and product range as variables captured from a custom dialogue.  After that you can plonk them on the layout wherever you want, in whatever format you want.

          But if the user just does Ctrl+F and types in their own search criteria... sorry: I can't help.

          • 2. Re: Can you save a "find request" as a variable?

            But that is possible also.

            Write a script such as:

            Set variable [$$DateRange ; Value: Yourtable::DateField ]

            Select Layout Setup | Script Triggers

            Select the OnModeExit trigger and specify that this trigger be tripped for exiting Find Mode.

            Set it to perform the above script and everytime ANY find is performed on this layout, any criteria entered into YourTable::Datefield will be captured in the global variable $$DateRange.

            • 3. Re: Can you save a "find request" as a variable?

              Excellent -- this was exactly what I wanted.