5 Replies Latest reply on Sep 7, 2013 10:22 AM by philmodjunk

    Autofill/autocomplete certain fields with relative information from a different database

    JavierTormes

      Title

      Autofill/autocomplete certain fields with relative information from a different database

      Post

      Before posting this I’ve searched and searched, the problem is I don’t know what exactly to search not in english neither in spanish.

            

      So, here’s the thing:

            

      I’ve made a small database for some actors I work with, with some info about them and the current work they’re doing, so far so good.

            

      But I would like to make another database with the contact info of their managers, so that way, I could just select the manager from a list on the field “manager”, and the phone numbers and the emails pop in the corresponding fields “phone 1” “phone 2” “email 1” “email 2”.

            

      I suppose this is posible, I just can’t figure out how, additionally I’m no expert on relations among databases or tables.

            

      Athough I do speak some english, don’t be afraid to talk me like a 5 year old kid.

            

      I'm putting some screenshots of what I mean to happen (it's simulated manually). Behold the fancy animation I've made for you.

            

            

      fancy-animation-.gif

        • 1. Re: Autofill/autocomplete certain fields with relative information from a different database
          philmodjunk

               I understand that you want to select the manager's name and see their contact information? The details of that will depend on the way you structure that information in the manager's table, but the basic method is as follows:

               Define a relationship between Managers and Actors. I am assuming that each actor has only one manager:

               Managers-----<Actors

               Managers::__pkManagerID = Actors::_fkManagerID

               Format _fkManagerID where you select the manager as a drop down list or pop up menu using a value list that lists __pkManagerID as the first field in the value list and the Manager's name as the second field. That way, your users can select a manager by name, but the value list enters the ID field. Then you can use the field tool to add any fields from the Managers table to your Actors layout and they will disply info about the selected manager when you choose a value in the _fkManagerID field.

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

          • 2. Re: Autofill/autocomplete certain fields with relative information from a different database
            JavierTormes

                 Sorry but I fail to see how the fields of the contact information (phone, email) "get" the corresponding data, to pop it. Also I've tried what I think you mean but with no success.

                  

            • 3. Re: Autofill/autocomplete certain fields with relative information from a different database
              philmodjunk

                   Sorry but I fail to see how the fields of the contact information (phone, email) "get" the corresponding data,

                   Well there are no such fields--only the phone, email, etc fields already defined in the manager table. When you add fields from the Manager table to your Actors layout, they will display data from the selected manager's record if your relationship and value list formatted field are correctly setup.

                   

                        Also I've tried what I think you mean but with no success.

                   Feel free to describe exactly what you tried and the exact results that you got when it did not succeed.

              • 4. Re: Autofill/autocomplete certain fields with relative information from a different database
                JavierTormes

                     After studying your post until the verge of brain damage I think I've got it. I was not creating the "representante_ID" field, plus I wasn't familiar to the notation. 

                     Table "activos" with details of the assets

                     Table "respresentantes" with details of the managers

                     activos::representante>------representates::representante_id

                     This is working.

                     If i only could ask for a couple more things… I'd like to be able to create new entries to the related "representantes" table from the dropdown list (or aseamed but in the "activos" talbe. & being albe to show the name of the manager on the same field used to pop de dropdown list (now the user selects on the right to populate the fileds with the manager info)

                     Thank you already

                • 5. Re: Autofill/autocomplete certain fields with relative information from a different database
                  philmodjunk

                       I don't see any connection between your screen shot and what you are requesting.

                       If I match up the Spanish and English names correctly, you want to be able to create a new Manager record from the Actors layout?

                       The easiest way to do that is to add a button to the actors layout that will create such a new record when clicked:

                       Freeze Window
                       Go to Layout ["Managers" (Managers) ]
                       New Record/Request
                       Set Variable [$ManagerID ; value: Managers::__pkManagerID ]
                       Go to Layout [original layout ]
                       Set Field [ Actors::_fkManagerID ; $ManagerID ]

                       This creates a new blank manager record. If the needed fields from Managers are located on your Actors Layout, you can now just fill in that info directly from the Actors layout.