November 1, 200421 yr I'm having trouble scripting a combination AND OR search using FileMaker7. For example: A search for all records where Parameter_1 is A or B or C, AND where Parameter_2 is 1 or 2 or 3. Done correctly, this should find those records matching all nine permuations of the search criteria (A1, A2, A3, B1, B2, B3, C1, C2, C3). Hope this makes sense. Any advice? Thanks for your help, Michael
November 1, 200421 yr Do a perform find script step for the first set of OR's then follow that by a contstrain found set step for the second set of OR's. For the OR's use the add new request for each OR required. Rather than scripting by keyboard perform the first find using the proper layout in find mode, then go into the script select the perform find step and the parameters you just used should show up in the menu. Do the same for the contrain step. Rod
November 1, 200421 yr ANDs use the same request, ORs use new request. Thus you will need 9 requests. Your script will look something like this: Enter Find Mode [] Set field [1, "A"] Set field [2, "1"] New request Set field [1, "A"] Set field [2, "2"] New request Set field [1, "A"] Set field [2, "3"] New request Set field [1, "B"] Set field [2, "1"] New request Set field [1, "B"] Set field [2, "2"] New request Set field [1, "B"] Set field [2, "3"] New request Set field [1, "C"] Set field [2, "1"] New request Set field [1, "C"] Set field [2, "2"] New request Set field [1, "C"] Set field [2, "3"] Perform Find []
November 1, 200421 yr You can use Duplicate Record/Request to streamline it. Enter Find Mode [ ] Set Field [1, "A"] Set field [2, "1"] Duplicate Record/Request Set field [2, "2"] Duplicate Record/Request Set field [2, "3"] Duplicate Record/Request Set field [1, "B"] Duplicate Record/Request Set field [2, "2"] Duplicate Record/Request Set field [2, "1"] Duplicate Record/Request Set field [1, "C"] Duplicate Record/Request Set field [2, "2"] Duplicate Record/Request Set field [2, "3"] Perform Find [ ]
November 1, 200421 yr Author Ralph's method works, but I need something more flexible, since users will be entering their own combinations of values. Rod's method works perfectly, but I need to automate this with a script. Is there a way to perform or simulate "add new request" in a script? --------------- Thanks, Michael
November 1, 200421 yr You can have the search done in Browse Mode using globals. Then use the script steps above, substituting your global field names for A, B, C, 1, 2, 3 (and don't use quotes). New Record/Request is the step you seek.
November 2, 200421 yr Author The script works! The "New Record/Request" step was exactly what I needed to make this work. Thanks everyone. ----------- Michael
Create an account or sign in to comment