2 Replies Latest reply on Dec 22, 2009 12:41 PM by wmixter

    Search Fxn and Web Compatibility

    wmixter

      Title

      Search Fxn and Web Compatibility

      Post

      Hello!

       

      Ok, so I have been struggling with this issue for awhile now, and would LOVE any advice on it.

       

      So, I've been customizing a Documents Library and have created a global search box that sorts through all fields to find records that contain that search. Essentially it is your basic keyword search. Well, it seems to be working fine as long as the search word matches a record. If not, an error box pops up, etc. Well, this is all fine when searching in filemaker, however it is causing some issues for me in my web publishing version. Essentially, the script is pausing, and  does not let me then edit the keyword and perform a new search. Is there some sort of 'If' statement I can put into my script that states "if no matching records, enter browse mode/exit script" --Something that will do this automatically deal with the "no match" issue?

       

      My currect script for my global search button looks like this:

       

      Enter Find Mode []

      Set Field [Document Library::Combined field; Document Library::Global Search]

      Perform Script ["Find"]

      Go to Layout ["Form View" Document Library)]

       

      Please help! Sorry that was kind of confusing. If you think you can help but aren't 100% sure if you know what I'm asking, I would love your input anyway! :)

        • 1. Re: Search Fxn and Web Compatibility
          philmodjunk
            

          Enter Find Mode []

          Set Field [Document Library::Combined field; Document Library::Global Search]

          Set Error Capture [on]

          Perform Find []

          If [ Get ( FoundCount ) = 0 /* no records found */ ]

            # do what you want to have happen when no records are found

          Else

            # do what you want to have happen when records are found

          End IF

           

          Set Error Capture [on] is what keeps the "no records found" dialog from popping up and interrupting your script.

           

          Instead of Get ( FoundCount), you can also use Get ( LastError ) and use the value returned to show different results based on why no records were found. (You can look up error codes in Filemaker Help.)

          • 2. Re: Search Fxn and Web Compatibility
            wmixter
               Perfect!! Thank you SO much!