2 Replies Latest reply on Jun 12, 2017 11:31 AM by siplus

    Exporting Related Records

    embeco

      I have a master inspection record and many related section records each in their own tables. There is only one matching section record for each inspection record. I am searching for a set of inspection records for a date range which I then want to export to an Inspection table in another directory (Archived Files).

      I also need  that the related section tables entries also export to their associated tables in the archived files directory.

      Basically I am exporting (archiving) an entire system database for inspections for a particular date range.

      I thought that I could find the inspections I wanted to export and then when I exported section records it would only export RELATED section records for the Inspection found set. Evidently this is not the way it works.

      Do I have to issue a find command for each section table to go out and find the one section record related to my inspection record? And I suppose that I will have to do this for each inspection record in the Inspection found set. In other words a big loop??

      Loop

      Read the first inspection record in the found set and export it to the Inspection table

      Find the related Section 1 record and export it to Section 1's table

      Find the related Section 2 record and export it to Section 2's table...  Etc

      Loop back to the next Inspection record

      Is there any easier way to do this?

        • 1. Re: Exporting Related Records
          philmodjunk

          Context is key. To export just the related records, do it from a layout whose table occurrence references the table of records you want to export.

           

          Do your find to find the section records. Then use Go To Related Records with the "match found set" option specified to pull up a found set of related records on a layout based on that related table. Now you have a found set that can be exported from FileMaker as a file or imported from if you want to import this data into a different FileMaker table (even if in another file).

           

          Note that the Table occurrence that you specify for the layout where you produce the found set of records should be the table occurrence that you specify for importing or exporting the records.

          • 2. Re: Exporting Related Records
            siplus

            embeco wrote:

             

            I have a master inspection record and many related section records each in their own tables. There is only one matching section record for each inspection record.

             

            Stopped reading here.