I have a performed find made.
How can I save and restore that found set in script steps?
Do you want to save the find criteria, or the found set of records?
Do you want to save multiple found sets and have the ability retrieve them, or just always just one found set?
You can not save the Found set as Saved Found set with any FileMaker Script Steps. What you should build if you have certain searches that you do frequently is to build a script that does that specific search for you and add a button on your layout to trigger the search
I have multiple found sets and want the ability to retrieve them.
The question still needs to answered: Save the criteria or save the set? If you Save the criteria, any changes to your records since the save, might produce a different found set as different records might match your criteria.
Example: say you find all employees where job description=assistant manager and find five records. If you save the criteria and one is promoted, using the saved criteria to bring up a found set now finds four records. If you save the found set, you get the same five records even though one of them is no longer an assistant manager.
You can “save the set” by storing a list of your found set’s primary keys in a text field in a record in your solution. The “list of” summary field makes tha easy to do. You can then use a relationship or a looping script to reproduce the found set.
If you want to save and restore multiple found sets, one way would be to make another table, call it Sets. Here's a link to some free videos from Jaymo (John Mark Osborne). These videos are a great instructional resource. I purchased these videos and watched them many times over the years. They are well worth the small price:
Filemaker Pro 12: Advanced Training Course
Scroll down to "Save Found Set"
Remember this is from FM 12, so for newer versions you can take advantage of the List of summary field.
Here's a link to his training website:
And a link to his fantastic blog:
Johan Hedman wrote: You can not save the Found set as Saved Found set with any FileMaker Script Steps.
Johan Hedman wrote:
You can not save the Found set as Saved Found set with any FileMaker Script Steps.
You sorta can, by using the TOG hopping technique. You can park your found set and retrieve it later. You can only do it with one found set though, it wouldn't 'store' multiple. And you need to add a dedicated TO for it.
You could also save multiple found sets via a Snapshot Link.
Need to save the criteria.
I have done this with global fields used for the search criteria entry. Capture the values before "submit-for-find" and you can call them up again.
But you must script this. Storage of the criteria can be into a single field (with name/value pairs, for example). But you need to have a column/field(s) to know what the find is (a name, date, who, etc.)
The Snapshot links allow you to capture the find and the sorts with minimum fuss.
You would also need to identify the find as a find or omit. The request might be a constrain or extend. Could be an AND or an OR find. Could be a number of find request followed by a constrain step. Many things to consider.
I worked on something a process to store search criteria recently. Think about this more I think I have a great idea.
Retrieving data ...