4 Replies Latest reply on Aug 26, 2013 9:43 AM by philmodjunk

    multiple fields search

    emmawatson

      Title

      multiple fields search

      Post

           I have made a layout for search that have only 1 field (contact number).

           Also I have 2 tables in my db. I want to enter contact number in the field and perform search through 2 tables that may have these records. And get the result on one layout.

           How can I script this?

        • 1. Re: multiple fields search
          davidanders

               Google threads on this site   "script muliple field search site:forums.filemaker.com"

          https://www.google.com/search?q=script+muliple+field+search+site%3Aforums.filemaker.com

               Contact Number is an ID # used in relating the 2 tables?

               The search layout will display the results?

               The search layout will displayed in a popup window?  Or in a Custom Message?

          • 2. Re: multiple fields search
            philmodjunk

                 Why is the contact number recorded in two different fields? You may find that there are a number of advantages to combining your data in a single table instead of having it in two.

                 Given that you have two tables with the same info, you may want to use a method that does not require any scripting or performed find. You can define a field for looking up the contact number and link it in a relationship to both of the tables that you want to search. Then you can place two portals on your layout. When you enter the contact number in this match field, any related records will appear in the portals. A button in the portal row of each portal can then use Go to related records to take you to a detail view of that record.

            • 3. Re: multiple fields search
              emmawatson

                   There are 2 different tables with different fields (for different purposes) that have different records.

                   I need to enter number in the field on search layout, search, and have the results from both tables on a new "results layout".

                   Results layout should look like smth:

                   table 1:

                   record 1

                   record 10

                   record 15

                   table 2:

                   record 1

                   record 2

                   record 5

              • 4. Re: multiple fields search
                philmodjunk

                     And that could be two portals listed one above the other.

                     But I'd use 1 table with the number in it and, if necessary, link it to the other two for the "different purposes". That would give me a single table to search instead of two.

                     And if you can't get two portal's to work, you'll need to set up a third table anyway so that you can import the data from each found set into a common table for listing in your report.