4 Replies Latest reply on Jan 11, 2015 11:50 AM by boz1972

    Saving found sets into a new layout


      I am new to FMP and coding but am learning quickly. I have created a simple database with 2 layouts. One is a list view of all the records, the other is a document view for individual records. I need to save my search results into another layout. This layout will be used to create sets of search lists hopefully with one record holding all of a particular search. I will then need to be able to open these sets of search records in list view. Can anyone point me in the right direction or is there a tutorial or similar that can help?

        • 1. Re: Saving found sets into a new layout

          If the searches are something you will do regularly with the same criteria you can writes scripts for the various finds then run the scripts via the scripts menu or from a layout with buttons for the different scripts.


          If the search criteria changes, you could use saved finds: http://help.filemaker.com/app/answers/detail/a_id/7052/~/saving-find-requests-for-use-in-future-filemaker-pro-sessions


          To do specifically what you are asking, you could create a table with the fields to hold your search criteria. The write a script to do a find in you data table using the the search table criteria.


          The script may be something like:


          Set Variable [$criteria1; Value "CriteriaTable::Field1"]

          Go To Layout ["DataTable List View"]

          Perform Find (where DataTable::Field1 = $criteria1 )


          Put a button to run that script on the Search Criteria Layout and each new record can have a different set of criteria

          • 2. Re: Saving found sets into a new layout

            boz1972 wrote:


            I am new to FMP …


            If “new to FM” also means that you are using FM13, then you could use the summary type “List of” to get a list of your table's primary IDs from the found set, then save them in a field in a purpose-built other table (where you could also add fields for metadata like date, description, tags etc.).


            Then create a relationship between your SavedFinds table and your “simple“ table like


            SavedFinds::IDs = SimpleTable::primaryID


            Now, to if you go SavedFinds and wish to see the records whose IDs you've stored in the current record, use Go to Related Record [ SimpleTable ], targeting any SimpleTable layout you wish.


            Let us know if that suggestion makes sense and if you need help with implementing it.


            All this of course assumes that you want to search the search result, not its criteria.

            • 3. Re: Saving found sets into a new layout

              If you need to have your initial list view of all records open all the time, you can open a new window for each new search. It is possible to have multiple windows open at once, all on the same layout and all with different found sets visible.

              • 4. Re: Saving found sets into a new layout

                Thank you all, have not been able to get to my project until now. Will let you know how it goes.