5 Replies Latest reply on Nov 30, 2012 12:28 PM by ClayReed

    Dynamic Portal Sorting

    ClayReed

      Title

      Dynamic Portal Sorting

      Post

           I am having difficulty getting Dynamic Portal Sorting to work. I have 3 tables one named "Projects" another "Assets" and then a join table between them named "ProjectAssets". My portal is located on the Asset Layout (Layout based on the Asset table) and the portal's related records are from the join table "ProjectAssets". The portal fields I'm wanting to sort are from the "Projects" table not the "ProjectAssets" table. The solutions I have found online all of the field to sort are only one relationship away not two as in the case of this solution. I attached a screen shot of the solution I am trying that shows 4 sort fields as well as the script. This solution also requires the relation between the two tables to sort by the 4 sort fields. Any ideas or other solutions I should try are greatly appreciated.

           Here is the solution I am using: http://www.youtube.com/watch?v=gCYqlgFflfI

            

            

      portalsort.jpg

        • 1. Re: Dynamic Portal Sorting
          ClayReed

               Anyone? : )

          • 2. Re: Dynamic Portal Sorting
            philmodjunk

                 Please document the relationships between your three tables.

            • 3. Re: Dynamic Portal Sorting
              ClayReed

                   My three tables as listed above are "Projects", "Assets", and the join table is "ProjectAssets". The relationship between them is a primary key in "Projects"and "Assets" and corresponding foreign keys in the "ProjectAsssts" table. The question is where should the sort relationship be, using the 4 sort fields I created - that's the problem I'm having. The solution I am replicating requires the sort relationship to be between the "Assets" table and the "ProjectAssets" table. This DOES work if I am sorting the fields that reside in the "ProjectAssets" table but does not work sorting fields from the "Projects" table which is what I'm needing.

                   In a nutshell I have a layout (based on the "Assets" table) with a portal showing related records from "ProjectAssets" table. I have fields from the "Projects" table located on the portal. These "Project" fields are the fields I want to sort. Maybe there is a better solution?

                    

                   I hope this makes since.

              • 4. Re: Dynamic Portal Sorting
                philmodjunk

                     These would then be your relationships:

                     Projects----<ProjectAssets>-----Assets

                     Projects::__pkProjectID = ProjectAssets::_fkProjectID
                     Assets::__pkAssetID = ProjectAssets::_fkAssetID

                     A portal can't sort on fields that aren't in the portal's table occurrence. To sort on fields from Projects in your ProjectAssets table, you'll need to add calculation fields in ProjectAssets that copy the data from Projects.

                • 5. Re: Dynamic Portal Sorting
                  ClayReed

                       Bingo! Thanks Phil!