rivet Posted February 11, 2003 Posted February 11, 2003 Saving a search query. I would like to keep a log of what poeple have searched for is that possible?
Pupiweb Posted February 11, 2003 Posted February 11, 2003 Not exactly a straightforward task. You'll need to script the search and - before it is carried out - loop thru the fields and grab the value that have been entered in each field ... If searches are complex (OR/Omit searches) things might become really complex: take a look at this tip file http://www.buliga.it/TipFiles/SFISearch.sit http://www.buliga.it/TipFiles/SFISearch.zip for an example
BobWeaver Posted February 12, 2003 Posted February 12, 2003 Not exactly straightforward is right. Here is a script that I wrote a while back to find the criteria of the most recent find operation. Some of the complexity of the script is due to the formatting that it does. It requires Applescript to get the correct omit/find choice of each request, So, it won't be completely accurate if you run it on a PC. # GetFindCriteria # "This script retrieves the find criteria used in the last successful find operation." # "The criteria are placed in the global text field "gSearchField"" # "" # "To customize this to your application, do the following:" # "1. Create the global fields that are used as the results in the Set Field steps below." # "2. Change the indicated step below, as described. (marked with '*****')" # "" # "" # "" # "The only way to determine whether the find requests have the omit box checked is to use Applescript." # "So, that info can not be determined on Non-Macintosh platforms." If [ Abs(Status(CurrentPlatform))=1 ] Perform AppleScript [ Script Attachability: Script Text: "tell front window of app "Filemaker Pro" set AllOmitStatus to "" repeat with ThisReq from 1 to (count requests) set IsOmitted to omitted of request ThisReq if IsOmitted set AllOmitStatus to AllOmitStatus & "1" else set AllOmitStatus to AllOmitStatus & "0" end if end repeat set cell "gOmitted" of current record to AllOmitStatus end tell" ] Else Set Field [ gOmitted , "00000000000000000000000000000000" ] End If # " ***** Change the following step as necesary to use a layout that contains all searchable fields." Go to Layout [ AllFields ] Modify Last Find # "If there were no valid find requests, mode will not change to find." If [ Status(CurrentMode) != 1 ] Set Field [ gSearchField , "No valid search criteria" ] Go to Layout [ original layout ] Exit Script End If Set Field [ gFieldCount , 0 ] # "Count the number of non-global fields" # "Pick any field to start on." Go to Next Field Set Field [ gSearchField , Status(CurrentFieldName) ] Loop If [ LeftWords(FieldType(Status(CurrentFileName), Status(CurrentFieldName)), 1) != "Global" ] Set Field [ gFieldCount , gFieldCount + 1 ] End If Go to Next Field # "Done when the current field is the same as the start field." Exit Loop If [ gSearchField = Status(CurrentFieldName) ] End Loop Enter Browse Mode Set Field [ gSearchField , "" ] Copy [ gSearchField ] [ Select entire contents ] Modify Last Find Go to Record/Request/Page [ Last ] # "Loop for each find request." # "Concatenate all find criteria in each request. Insert a
Recommended Posts
This topic is 7959 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