3 Replies Latest reply on Mar 6, 2017 9:20 PM by philmodjunk

    Form View and List View Combined in Single Layout

    markmeer

      I'd like to create a layout that is a combination of a list view and form view.

      Something like the following:

      FM_Layout_Concept.jpg

       

      The concept is that the tabs on the left side list all records (e.g. via portal) - filtered by type (via dropdown) & status (open, closed) - and the user can click on one, and the details will display in the right side.  Basically, the left side is like a list-view, and the right side is like a form view.

       

      I've got an inelegant solution involving essentially duplicating details of records in a separate table, so that these can be displayed in a portal on the left side, and then scripting a find when user clicks on a portal row.  This is proving to be very cumbersome, as each update to the record on the right, then has to be duplicated in the associated record on the left.

       

      Wondering if anyone has a more elegant solution to implement the concept...

       

      Thanks in advance!

      M.

        • 1. Re: Form View and List View Combined in Single Layout
          philmodjunk

          You should find a number of working examples in this forum as this is not the first time it's been requested.

           

          One way is to set up a "self join" that links two occurrences of the same table in a Cartesian join:

           

          LayoutTO::anyNeverEmptyField X PortalTO::anyNeverEmptyField.

           

          A portal to PortalTO will list all records in that TO's table on your layout. Add filtering capability via portal filter expressions and the left side is done.

           

          Then make the fieldoe  row of fields in the portal row into a button, or add a button to the portal row to perform this script:

           

          Set Variable [$SelectedRecordID ; PortalTO::__pkTableNameHereID ]

          Enter FInd Mode [ pause: no ]

          Set Field [LayoutTO::__pkTableNameHereID ; $SelectedRecordID ]

          Perform Find [ ]

           

          That's all that's needed, though Go To Related Record could also be used here.

          1 of 1 people found this helpful
          • 2. Re: Form View and List View Combined in Single Layout
            markmeer

            Thanks!  I was unaware of the idea of self-joining tables.

             

            Some minor clarification questions:

            • Can the "anyNeverEmptyField" just be the primary key (as this will never be empty)?  Or is there a reason to select a field other than the primary key?
            • In your script, is there a reason to set a variable? Can you not just use "Set Field [LayoutTO::__pkTableNameHereID; PortalTO::__pkTableNameHereID]?

             

            Thanks again for pointing me in the right direction!

            • 3. Re: Form View and List View Combined in Single Layout
              philmodjunk
              • It pretty much can be any field. And the field, to correct myself, does not even have to be empty. You can even define a field to use for this, add the relationship and then delete the match fields and the Cartesian join still works. A primarykey field can certainly be used, just keep in mind that the field's actual value is not used to match record in this relationship.
              • You need the variable if you are going to perform a find. Watch what happens to fields when you enter find mode, they become blank so you have to copy the value into a variable (a field with global storage could also be used.), so that the value doesn't disappear on you when the window enters find mode.