2 Replies Latest reply on May 24, 2016 11:18 AM by iimpact

    Creating a new record in a portal that is populated from a separate table

    iimpact

      Hello,

       

      I've been using this community a lot and it has been very helpful during my FileMaker learning process. Though, I've came across a scenario that I can't seem to figure out.

       

      Here is the current relationship:

       

      Screen Shot 2016-05-23 at 8.00.28 AM.png

       

      What I am trying to do is within the Sample Layout, assign X amount of Methods to the sample. Methods are populated and saved independently from another layout. Right now, everything appears to be saved and assigned correctly, as new PK's are getting created inside the Join table, but when I try and display the assigned Methods within the Sample Layout, I only see the first name of the Method that is defined in the Method table (even though it's FK in the Join table is for a different name). I believe my relationship is wrong somewhere, and would like some help in structuring it correctly.

       

      Note: The Joiner table has 2 FKs, one FK for Sample and the other FK for Method.

       

      My current script I use to assign a Method to a Sample is:

      Screen Shot 2016-05-23 at 8.11.22 AM.png

       

      Another quick question, why is there a need to duplicate the Joiner table and save to that? I have found this pattern in a few other examples posted here, where the duplicated Joiner table was getting saved to (and named either NEW_ or Create).

       

      Thanks a lot of the help, and I am looking forward to any response.

        • 1. Re: Creating a new record in a portal that is populated from an separate table
          erolst

          iimpact wrote:

          Note: The Joiner table has 2 FKs, one FK for Sample and the other FK for Method.

          If sample method is your join table, then your data model is wrong; the JT needs to be directly related to both parents via FK = PK, so

           

          Sample --< JT >-- Method

           

          You need that Method table occurrence in addition to the Cartesian one you use as selector; that latter is for your user interface (show all methods), but the first one is a structural component (tie a reference FK to its source PK and give direct access to that entity).

           

          iimpact wrote:

          Another quick question, why is there a need to duplicate the Joiner table and save to that?

          Only if you want to a) create related records via a portal, AND b) have a portal for display where the user should be able to edit, but not add records. Since the ability to add records in a portal is a relationship setting, you would have two relationships (and need two TOs of the target table) that are identical except for that setting.

           

          There are other methods to create related records, so this isn't a necessity.

          1 of 1 people found this helpful
          • 2. Re: Creating a new record in a portal that is populated from an separate table
            iimpact

            Thanks, updating my JT to add another reference to the Method table's PK worked.