5 Replies Latest reply on Jul 7, 2011 10:17 AM by philmodjunk

    Creating contact look up that allows selection between multiple results

    AlexMauer

      Title

      Creating contact look up that allows selection between multiple results

      Post

      HI,

      I am developing a mailroom packge delivery system. I am using FMP11 advanced, FMP11 and filemaker Go. The tool will allow for the scanning of package bar codes and the selection of the recipients name address email phone etc from a look up of a name table.

      THere are two tables, the shipping table and the phonebook table. The phonebook table has all our employees in it with phone, email, office location, first, last and firstlast. I also created an employee ID that is unique. In the data entry screen, The user will enter new packages into the system when they are setting up the delivery runs. they start by scanning the package barcode. Then they go to the recipient last name field and start o type the last name in. when they tab out of the field, the rest of the contact info is filled in from the phonebook. This works great except when I get to Smith. If I type in smith, it chooses the frst record it finds. I need to deliver a package to david smith not ann smith. 

      Is there a way to seach on the last name so that the first name gets populated with the 5 smith names? I am thinking of a sort of dynamic value list tha tgets created fro the results of a "Smith" query. I want to save the auo fill in of all th e contact info until the first name is selected If there are not multiple search returns - the last name is nique then it returns all the contact info, but if there are 5 smiths then the first name beomes a dropdown showing th e 5 possible first names. Once you select the first name, then the contact info populates.

      I am a FMP novice. any hep would be greatly appreciated. 

        • 1. Re: Creating contact look up that allows selection between multiple results
          philmodjunk

          There are several ways you can use scripts to enhance a value list selection process. The following download file demos several options. All of these options permit text based partial data entry of names, but actually looks up and enters ID numbers. All of the methods permit duplicate names and provide ways for the user to select the correct name from a list of matching duplicates.

          http://www.4shared.com/file/plr_jbkk/EnhancedValueSelection.html

          Feel free to reply with questions if you need help understanding how one of these methods works.

          • 2. Re: Creating contact look up that allows selection between multiple results
            AlexMauer

            Ok, I think this gets me to where I want to be, but I am unsure of execution.. Let me run this up the flag pole.

            I have 2 tables 1 shipment and 2 Phonebook

            Phone book has these fields:

            contact ID (unique#)

            Fname

            lname

            email

            phone#

            first&last

            Department

            The shippment tracking side, The user will scan and enter the package into the system to be delivered later. I want them to add thename of the package owner by typing the last name. The last name then triggers a search. so If I type Mauer, there is only one result. as I tab out of the field, it populaes the first name, email and office location phone# etc to the data entry screen. If they type in Smith it will drop down like the first two drop downs in your example.

            The second one functions the way I want it to. when you type in the description it narrows down to your closest selection. and if there are multiple smiths, you can look into the dropdown. The phone book table has a firstlast column where I ombine the names with a calculation. So that would probably be better to use.

            But I don't really know where to start with making this start.

            • 3. Re: Creating contact look up that allows selection between multiple results
              philmodjunk

              You start with the correct relationship:

              PhoneBook::contact ID = Shipment::Contact ID

              Regardless of which method you choose to use, your script will cause the selected contact info to appear by entering Contact ID of the selected person in to the Shipment::contact ID field. If you place the name, email, location fields from Phonebook on your shipment layout, the correct info will automatically appear when the ID number is entered by the script into the field.

              Before you try to get a scripted method to work, you may want to start with a drop down on Shipment::ContactID similar to the drop down defined on the Prod ID field, then add the more enhanced options once you have this first drop down working. (It doesn't require any scripting.) Do you know how to create such a value list?

              Here's how to explore the scripts found in this demo file:

              In layout mode, you can select any one of thes search or drop down fields, right click them, select script trigger and you can see the name of the script that is performed so you know which script to open and examine. If you then click Select, you get a dialog box that shows you were the script is located in manage scripts and there's a gear drop down where you can select edit to open the script editor in order to look at the script.

              Both drop downs use the same script but since they use different fields for the drop down they pass the text entered into the field as a parameter to the script. There's a second parameter, "Add" or "Current" that is used to help the script interact with the portal. You won't have a portal, so this won't be needed in your version of this script.

              • 4. Re: Creating contact look up that allows selection between multiple results
                AlexMauer

                Hello phil,

                Any chance I can get you to look at my DB and tell me where I am going wrong? I have been over and over your enhanced value selection and I just can't seem to get this to work.

                THanks, Alex

                • 5. Re: Creating contact look up that allows selection between multiple results
                  philmodjunk

                  You can upload a copy of your file to a file share site and post the download link here if you want. Use the save a copy as | Clone option if your file contains info you don't want to make public.