AnsweredAssumed Answered

"Advanced Search" part 2

Question asked by user16037 on Oct 31, 2011
Latest reply on Nov 23, 2011 by user16037

Title

"Advanced Search" part 2

Post

 ref:

Creating "Advanced Search" Layout
Forum post posted September 23, 2011 by mat curtis
 
I have been trying to create an advanced search page to search a library catelogue. The issue that I am having trouble with is to add a series of operators in to create "And", "Not" and "Or" searches.
 
The following script that PhilModJunk devised, works very well to create searaches based on a single text input and the user choosing which field the criteria relates to. This gives an "Or" search if two or more fields are chosen. I would like to expand that by adding another Value list that allows the user to perform searches in other fields that create an add, include or omit search criteria from the found set.
 
Thanks for your help
 
  • If [ ValueCount ( global fields table::SearchFieldsList ) ]
  • Go to Layout [ “Record View” (IMarEST test db) ]
  • Enter Find Mode [ ]
  • Loop
  • Set Variable [ $I; Value: $I + 1 ]
  • Set Field By Name [ "IMarEST test db::" & GetValue ( global fields table::SearchFieldsList ; $I ); global fields table::SearchText ]
  • Exit Loop If [ $I = ValueCount ( global fields table::SearchFieldsList ) ]
  • New Record/Request
  • End Loop
  • Pause/Resume Script [ Indefinitely ]
  • Set Error Capture [ On ]
  • Perform Find [ ]
  • If [ Get ( FoundCount ) = 0 ]
  • Go to Layout [ “Record View” (IMarEST test db) ]
  • Show Custom Dialog [ Title: "No Record Message"; Message: "The were no records matching these criteria found"; Buttons: “OK” ]
  • Else
  • Sort Records [ Specified Sort Order: IMarEST test db::Subject; ascending ] [ Restore; No dialog ]
  • End If
  • Else
  • Show Custom Dialog [ Title: "No Field error"; Message: "No field was selected for these search criteria"; Buttons: “OK”, “Cancel” ]
  • End If

Outcomes