5 Replies Latest reply on Jan 19, 2012 7:09 PM by lienert

    Layout field related to portal row

    lienert

      Is it posable to have a field on the main layout display data from the related record you have selected on a portal row.

       

      e.g. if you have a notes field that has a lot of data in it there may not be enough room to display this on the portal row its self. So I was wanting to put the notes field on the main layout below the portal. Then when you select a different portal row it will change to displaying that records notes. At the moment I have the field on the main layout referencing the related record but it just displays the data from the record at the top of the portal. I cant change when i select a diferent portal row.

        • 1. Re: Layout field related to portal row
          psijmons

          Yes Lienert, that is very possible.

           

          Make another Table Occurrence of the related table.

          Add a global field to the primary table and link that to the primary key of the new TO.

          Add layout fields that are based on the new TO.

           

          Then prepare a script on the portal row that filles the global field with the primary key of the row that the user selects (e.g. take the primary key from that row as Script parameter).

          • 2. Re: Layout field related to portal row
            RayCologon

            Hi Lienert,

             

            I would add a couple of points to the excellent suggestion made by pjsimons, as follows:

             

            1. Unless the relationship your portal is based on is a cartesian product (X operator) join, you should include the relationship predicate (key match) of the portal relationship along with the global field to primary key predicate. This will ensure that a portal selection on one record won't result in data from a portal selection on one record continuing to appear after the user navigates to a different (parent) record.

            2. When implementing this technique, it's also a very good idea to apply conditional formatting to an object that spans the portal row, with a formula along the lines of Child::ChildID = Parent::gSelectedChildID, and select a fill color - so that the user can easily see which portal row has been selected.

            3. Unless there are other actions you need to perform as the row selection changes, you don't strictly need a script for this purpose - you can simply attach the Set Field[ ] command directly to the portal row object(s).

             

            FWIW, attached is a simple demo that shows the technique in action, and taking into account the above three aspects.

             

            Regards,

            Ray

            ------------------------------------------------

            R J Cologon, Ph.D.

            FileMaker Certified Developer

            Author, FileMaker Pro 10 Bible

            NightWing Enterprises, Melbourne, Australia

            http://www.nightwingenterprises.com

            ------------------------------------------------

            1 of 1 people found this helpful
            • 3. Re: Layout field related to portal row
              timwhisenant

              Hi Lienert,

               

              If you are using version 11 another simple way can be considered.

              Place a merge variable on the layout to copy the note text onto like <<$$ActiveNoteText>>.

              Make the portal row an invisible button, that when clicked executes a set variable step like SetVariable[ $$ActiveNoteText; MyNote:Text].

              While the merge variable has a value it will appear on the layout, when empty it will dissappear.

               

              No relationship overhead, just pure UI.

               

              In FM there is always more than one solution.

               

              Hope This Helps,

              Tim

              • 4. Re: Layout field related to portal row
                RayCologon

                timwhisenant wrote:

                In FM there is always more than one solution.

                 

                Agreed, Tim.

                 

                And in case Lienert is looking for still more options or is concerned about minimizing relationship overheads, FWIW there's a third method illustrated in the free demo at the following link:

                 

                http://www.nightwingenterprises.com/demosX/demoX10.html

                 

                As well as not requiring any relationships (other than the one the portal is based on) this method works in FileMaker versions several back from 11. ;)

                 

                Regards,

                Ray

                ------------------------------------------------

                R J Cologon, Ph.D.

                FileMaker Certified Developer

                Author, FileMaker Pro 10 Bible

                NightWing Enterprises, Melbourne, Australia

                http://www.nightwingenterprises.com

                ------------------------------------------------

                • 5. Re: Layout field related to portal row
                  lienert

                  Thanks all for your help.