Heathbo Posted April 20, 2005 Posted April 20, 2005 Is there a way to save a found set and then go back to it later?
aaa Posted April 20, 2005 Posted April 20, 2005 What you want to save Found Set or Find Request? If Find Request, construct it once then save it in script by Perform(restore) If Found Set then after Finding export your records to any file the open it how many times you want. Or Save a copy as...... All this you can do by script.
Heathbo Posted April 20, 2005 Author Posted April 20, 2005 Find Request is what I'm looking for. I can't find the Perform(restore) in the script window. Can you create an example I can download?
Lee Smith Posted April 20, 2005 Posted April 20, 2005 Look at the Option boxes that appear when the Script Step "Find" is selected ([color:"blue"]ScriptMaker >> Select Script involved >> Edit box >> Script Step >> Find ). You may want to look at these example files on how to save your sets: Saving the Found Set of Records By: John Mark Osborne URL - Click Here Saving the Found Set By: Jon Rosen URL - Click Here HTH Lee
Heathbo Posted April 20, 2005 Author Posted April 20, 2005 OK, I'm not quite following. Say for example I perform a find that finds the records titled Apples, Oranges, and Pears. I want to save this find result so I can come back to it without having to do another find. I hope I'm not making this more difficult and confusing than it has to be.
spb Posted April 20, 2005 Posted April 20, 2005 Let me see if I can paraphrase Lee. After you manually find your Apples, Oranges & Pears, open Scriptmaker. Type a new name in the bottom window (Find_Apples or whatever), then click Edit. In the function list on the left, click the drop-down at the top and choose "all by name." Now scroll down to the "P's" in the alphabet, select Perform Find and double-click it, moving this script step into the previously empty window on the right. Make sure the "Restore" option on the bottom of the screen (visible when you click the Perform Find script step in the right window) is checked. Now click okay, done, etc. and close all Scriptmaker windows. Your new script will have defaulted to showing up in the top drop-down under "Scripts," and you can run it from there. But you may want to go into layout mode and make a small button labeled "Refind Apples" and apply this new script to it. Now, whenever you need that found set back, click your new button, or go to "Scripts" at the top of the screen where it will appear in the drop-down. Viola! Apples, Oranges and Pears in an eyeblink. If you have a bunch of these finds you need to refer to, you could make an array of buttons and assign a separate find script to each one. The easiest way to do this (for finding Lemons and Strawberries) is to manually find the new items. Then open Scriptmaker, highlight your Apples script, click the Duplicate button and rename the duplicate script Find_Lemons. Click Edit to display the one-line script, then close the window. When you do, a pop-up window will appear to rpompt you if you wish to keep or replace your find criteria. Click "Replace" and it will adopt the new Lemons & Strawberries criteria. Close Scriptmaker. In Layout, apply this new script to a button next to Refind Apples, call it Refind Lemons. Click the Refind Apples button, blink, there they are. Click the Refind Lemons button, instantly Apples, etc. are replaced by Lemons, etc. Steve Brown
Heathbo Posted April 27, 2005 Author Posted April 27, 2005 The restore option isn't on the bottom of the screen. I'm using Filemaker 7, maybe that makes a difference. The other problem is, I need to keep the find criteria a variable. Basically this is whats going on. The user performs a find based on whatever they type in the fields. They then run a script that isolates the current record and exports it into a seperate file. The export process performs a find to isolate that one file. I need to be able to get back to the original find after the export script. I hope there is a way to do this.
spb Posted April 27, 2005 Posted April 27, 2005 You're right. I am working on FM 6 and 7 could well have aspects that differe. I'm surprised the "restore" option is now gone, but that's a good thing. However, the basic use of scripts and global fields as I discuss below should be the same. When your user types their find criteria, are they typing it into a global field? Or are you allowing the user to go directly into Find mode & type into the actual fields? If the latter, you would be better off having the user type into global(s) instead. You could use this as a variable. Once your script does the find, exports & refinds, when navigating back to the original file it could simply perform the original find again, as the global field (relative to the user) will still contain the original find criteria. There are a variety of reasons to require a user to type whatever they want to do into global fields instead of "normal" fields. Another reason is data entry. Have them type new record info into globals. When they click a "commit" button, a script could analyze the typed info and display a warning if field characteristics are incorrect, four-digit zip code, for example. If the script is satisfied that the data is legit, it will make a new record and set the actual fields to the global contents, then clear the globals for the next entry. I set up this sort of data entry by giving the users a "new" button that takes them to a duplicate layout, except all enterable fields have been replaced by global equivalents. They never know the difference. The effect is that they just went into Find mode (all the fields seem to go blank). Steve Brown
Heathbo Posted May 2, 2005 Author Posted May 2, 2005 I've been doing the latter. So your saying, make a duplicate of the layout and replace all the fields with global versions? How would the script then flow? Would it be a set field in find mode in the actuall layout and not the global version? Thanks for your patience
Heathbo Posted May 4, 2005 Author Posted May 4, 2005 OK, I have the global fields set up. How do I create a script where the global fields are variables?
Heathbo Posted May 4, 2005 Author Posted May 4, 2005 Thanks for the tips spb. Got it working perfectly now. I may use this tecnique in a few other solutions comming up. Thanks again!
spb Posted May 5, 2005 Posted May 5, 2005 I just got back to the forum. Got your script working okay? Sounds like it. But just in case, the "commit" button script makes a new record, sets Field A to Global A, Field B to Global B, etc. Then it cleans up by setting each global to blank, or "". Steve Brown
Recommended Posts
This topic is 7145 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now