3 Replies Latest reply on Feb 18, 2014 1:15 PM by philmodjunk

    Creating related records

    DaniRoloson

      Title

      Creating related records

      Post

           My main table is from an External Data Source so avoiding the creation of additional fields there.

           So I created a related table by "Date Entered" and have added a "Machine Age" field that should look like "5y3m".

           I've made "Machine Age" unstored and I "Allow creation of records in this table via the relationship" but the table still has 0 records.

           How do I trigger the population of that table? Do I have to loop through the main table with a script?

           Or should I be changing it to a "One-to-one relationship" … can't find how.

        • 1. Re: Creating related records
          philmodjunk

               "allow creation...." enables you to enter data into the blank "add row" of a portal to the related table and then FileMaker will create the related record and copy over the needed match field values. It doesn't cause your table to automatically create a related record for every record in another table. It can also make it possible for Set Field--if performed from a layout based on the remote table, to create a single related record in the new table.

               If you want one related record in this new table for every record in your externally sourced table, then you'll need to set up a script to loop through the records of the external table and create one new related record in the new table.

          • 2. Re: Creating related records
            DaniRoloson

                 So is my statement:

                 My main table is from an External Data Source so avoiding the creation of additional fields there.

                 true or will the new field be protected by the fact that it doesn't exist in the EDS?
            • 3. Re: Creating related records
              philmodjunk

                   None of what I describe requires creating new fields in the external table as long as you already have a primary key field in the external table that you can use to define a one to one relationship to your new related table.