AnsweredAssumed Answered

Quick Find Script

Question asked by AlishaDenicola on Apr 22, 2014
Latest reply on Apr 24, 2014 by AlishaDenicola

Title

Quick Find Script

Post

     Hello, 

     I'm trying to create a field and button combo that will allow users to search the database. I am using an existing find script, but it continues to pull up a dialogue box with no dialogue in it, and it does not actually find the records searched for. 

     The script is huge, and I'm hoping there is a simpler way to perform a find. I need the search parameters to allow a user to search for any word in any field. 

     Current Script: 

     Commit Records/Requests [No dialog]
     If [ /IsEmpty (Contacts::varUberFind)*/]
         Show Custom Dialog ["Quick Find"; "Please Enter your find Criteria then press \ "Quick Find\""]
         Exit Script []
     Else
         Set Variable [$$quickfind; Value:"/*\"*\" & Contacts::varUberFind & \"*\"*/"]
         Set Error Capture [On]
         Enter Find Mode []
         Set Field [Contacts::Name; $$quickfind]
         New Record/Request
         Set Field [Contacts::Company; $$quickfind]
         New Record/Request
         Set Field [Contacts::Last; $$quickfind]
         New Record/Request
         Set Field [Contacts::First; $$quickfind]
         Perform Find []
         If [Get ( FoundCount ) = 0]
            Show Custom Dialog ["Quick Find"; /*"¶" & "No Contacts or Companies match " & Quote (Contact::varUberFind) & \"\¶\¶\" & \"Showing All Records\"*/"
            Show All Records
            Set Field [Contacts::varUberFind; ""]
          Else
            Set Field [Contacts::varUberFind; ""]
          End If 
     End If

     I'm not entirely sure why the original creator went with this script, but any way of simplifying this and actually making it work would be very much appreciated. 

     Thanks, 
     Alisha

      

Outcomes