4 Replies Latest reply on Feb 14, 2017 8:37 AM by philmodjunk

    3 tables in a layout

    Phil_Mac

      I'm trying to use related tables (TO's) on a layout,

       

      TO "Test"

      TO  "Samples"

      TO "Sample Test Data"

       

      I have a one to many "Test(one side)" to "Samples (many side)"

      I have a one to many "Samples (one side)"  to "Samples Test Data (many side)"

       

      I may be looking at this wrong but can't get it to function right

      the TO's   Samples and Sample Test Data I'm putting in portals on a layout but am having trouble getting the data to display right?

       

       

      Philiip

        • 1. Re: 3 tables in a layout
          Phil_Mac

          Capture.PNG

          • 2. Re: 3 tables in a layout
            philmodjunk

            And what is the right way to display the data?

             

            With the relationships you've defined, Putting portals to G48 Sample and G48 Lines on an SC lab testing layout should show all samples linked to the current record in SC lab testing in one portal. The other portal will list all test data records that are linked to any one of the sample records shown in the first portal. If that's what you are getting, it is working exactly as you have set it up to work, but that may not be the way that you want it to work.

             

            Frequently, what is wanted is to put a button in the portal row of the portal for samples that, when clicked, causes the test data for that one sample to appear in the second portal. This can be done, but not from what you have currently set up in your database.

            • 3. Re: 3 tables in a layout
              Phil_Mac

              Thanks Phil for the reply,

              "Frequently, what is wanted is to put a button in the portal row of the portal for samples that, when clicked, causes the test data for that one sample to appear in the second portal. This can be done, but not from what you have currently set up in your database."

               

              This is what I would want, for the portal "G48 Lines" to only show the data that is related from portal "G48 Sample" .

              I'm not sure how to go about setting that up.

               

              Phillip

              • 4. Re: 3 tables in a layout
                philmodjunk

                This is what I would want, for the portal "G48 Lines" to only show the data that is related from portal "G48 Sample" .

                That is what you have now and not what I am describing. Your portal to G48 Sample can list multiple samples. The portal to G48 lines will list sample data for all of the G48 sample records that appear in your portal all in one group. It will not show sample data form sample records that are not linked to the current "Lab" record.

                 

                To do what I am describing requires a different set of relationships:

                 

                G48 Lines>------SC Lab Testing------< G48 Sample   (----< means "one to many" )

                SC Lab Testing::__pkSCTestingID = G48 Sample::_fkSCTestingID

                SC Lab Testing::_fkSelectedSampleID = G48 Lines::_fkSampleID

                 

                You then place a button inside the portal row of the portal to G48 Sample that does this script:

                Set Field [SC Lab Testing::_fkSelectedSampleID ; G48::Sample::__pkSampleID ]

                Commit Records

                 

                You might try this both with and without the commit records step as it may not be needed here.