5 Replies Latest reply on Oct 9, 2015 5:00 AM by skipmckee

    populating list from table.

    skipmckee

      hello all

      thank you in advance for your help.

      i am trying to populate the attached form with the information from the wells table. the information in the wells table does not change. they show where on list to add data to fields.

      i would like the "list" to always show and as you enter field data, the time auto populates on entry.

      everything works but the "list of wells" any help would be greatly appreciated.

        • 1. Re: populating list from table.
          erolst

          Without looking into your table: if you have a Wells table and want to reference data from a specific record, add a foreign key wellsID to the table of your form, and create a relationship

           

          FormTable::wellsID = Wells::id

           

          Place the related fields from the Wells table as desired on your layout.

           

          To conveniently select a table, create a value list "Using fields from" Wells, 1. field: id (primary key), 2. field name, display only 2. field; format the foreign key field as popup and assign that value list. Now selecting a Wells name will insert a key, and establish a reference to that record.

          • 2. Re: populating list from table.
            IanRenwick

            Erolst showed you the way. I have modified your file and have attached it.

            Essentially I have created a value list called Wells ID that lists the ID field data from the Wells table.

            I created a portal related to the Wells Data table and added the 4 fields you were already displaying onto that portal.

            I added a drop down list to the ID field to select the appropriate ID (removing the script you had attached to it).

            You can double click on the portal and alter the number of records you wish to display.

            • 3. Re: populating list from table.
              skipmckee

              thank you both

              we are trying to keep the form as friendly as possible for the people in the field. i would like the well id to auto populate (all 26 to show from table.) so that the operator can just pick a row with the well id and add data. also this will keep track of wells that are completed.

              sorry but as a newlbie i don't know how to open attachments in forum if attached

              • 4. Re: populating list from table.
                IanRenwick

                Hi skipmckee,

                I have attached another modified file. Click on the file name "DO MEASUREMENT DATA FORM 4.fmp12" next to the paper clip icon to download it to your machine.

                If I have understood you correctly you want all 26 x Well ID's to appear in a portal when a new measurement form record is created. I have created a script called "Add new portal records" and a button at the top of the Measurement form layout to trigger the script.

                screenshot_361.jpg

                The script creates a new measurement record. It grabs the Record Serial number (you have used this as the key field) and goes to the Well data layout. It uses the value list of Well ID's to loop through and create a new data record and inserts the next value into the record. It finishes once it has looped through the whole value list. I added a "Match" number field to insert the matching Serial number from the Measurement record. (You also had an auto enter Serial number in the Well data table which was being used to join to the Measurement table - this wasn't going to display the data records on the Measurement Form layout as I think you were expecting?)

                 

                If you add new Well ID records you will need to increase the number of records to be displayed in the portal.

                • 5. Re: populating list from table.
                  skipmckee

                  Thank you so much for your time. It works great. Onward and upward

                   

                   

                    Skip McKee

                  Graphics Design

                  North Wind Inc

                  Phone: (864) 467-0811

                  Email: amckee@northwindgrp.com

                   

                  Please consider the environment before printing.

                   

                  This e-mail and any files transmitted with it may be business sensitive and are intended solely for the use of the individual to whom they are addressed. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please immediately advise the sender by reply e-mail and delete the e-mail. We appreciate your cooperation.