3 Replies Latest reply on Jul 8, 2010 3:24 PM by BodiceaOverall

    Check in background a record exists

    BodiceaOverall

      Title

      Check in background a record exists

      Post

      Hi

      I want to perform a search on a table to see if a particular record exists and if it does then display a message to the user.  I have no problem in obtaining the search criteria but how do I do it in script without invoking the layout that I want to perform the find on?

      I thought Freeze Window might work but it doesn't.

      Thanks, guys.

        • 1. Re: Check in background a record exists
          philmodjunk

          You have to refer to a layout that refers to the right table, that's the only way to establish a "table context", but you don't have to make this visible to the user.

          Freeze Window
          Go to layout [//specify the layout for the find]
          enter find mode[]
          #use set field steps to enter find criteria
          set error capture [on] //suppresses the "no records dialog" if none are found
          Perform find[]
          If [ get ( FoundCount ) > 0 /* records were found */]
             #Do what you want with the found records
          end If
          Go To Layout [original layout]

          • 2. Re: Check in background a record exists
            BodiceaOverall

            Thanks for fast response and there were a couple of lines in your example that have helped but the layout I want to perform the find on is still visible on screen.  I am now getting the 'script paused' buttons in the top right hand corner of the layout toolbar.  When I click 'continue' it performs the rest of the script as I would have expected it to.

            I have debugged the script and can absolutely say that the 'Freeze Window' is where you suggest.  I am running Filemaker on Windows XP.

            Any more suggestions?

             

            • 3. Re: Check in background a record exists
              BodiceaOverall

              S'Okay I have fixed it.  My [Enter Find Mode] parameter was set to Pause and the Window Freeze now works.  It just took me a while to find out how to switch it off!

              Thanks.