2 Replies Latest reply on Apr 9, 2009 8:10 PM by groovebox

    Multi-field find (FM10) - this works but is there a better way?

    groovebox

      Title

      Multi-field find (FM10) - this works but is there a better way?

      Post

      On a roll. Sorry about this!

       

      This is something I already do/use. Say I have a Table called Customers - and I have a indexed field that I calculate to store the concatenated result of "first name + last name + street address + suburb and so on" - then I script a find that takes the user to a simple layout where they can do a (scripted) find.

       

      So if they enter "John" then the user will be presented with every record that contains "John" in the first name/last name/address and so on. Which is fine and what I want. [These particular concatenated finds are great for phone numbers - eg: if they only have the first 5 digits of a phone number and a name.]

       

      Is there a better/different way? Is there too much overhead in this approach? My Customers table will be approaching the 100K mark and growing.

       

      I found an alternative style example file last year but can't find it now - I put it somewhere "safe". :)

       

      Thanks for reading.

       

      Respect.

       

        • 1. Re: Multi-field find (FM10) - this works but is there a better way?
          Orlando
            

          Hi groovebox,

           

          This approach is ok, but if you need to expand the field you want to search on you will need to modify the calculation each time. Whereas since you are already running a script you could use the script to perform the find on each individual field.

           

          I would suggest changing the calculated field you have to be a Text field and make it Global Storage from the field options.

           

          Then your script goes to the layout with that field as it does currently without the Enter Find Mode step, and I assume you pause it at the point the user inputs the search criteria, following the Pause step do the following:

           

          #
          Enter Find Mode [] // Deselect 'Pause' 
          Set Field [ CUSTOMERS::first name ; CUSTOMERS::GlobalSearchField ]
          New Record/Request  
          Set Field [ CUSTOMERS::last name ; CUSTOMERS::GlobalSearchField ] 
          New Record/Request  
          Set Field [ CUSTOMERS::street address ; CUSTOMERS::GlobalSearchField ]
          [etc...]
          Perform Find [] 

          #// Check result and if no records found alert user.
          If [ Get ( FoundCount ) = 0 ]
          Show Custom Dialog ["Message" ; "No Records Found."]
          Enter Browse Mode []

          End If 
          #  

           

          This will be easier for you to maintain than a concatenated calculation.

           

          If anything is unclear let me know and I will explain.

           

          I hope this helps.






          • 2. Re: Multi-field find (FM10) - this works but is there a better way?
            groovebox
              

            Thanks Orlando - very interesting. Will try it out this w/end and advise. Appreciated.

             

            Respect.