5 Replies Latest reply on May 18, 2016 12:04 PM by erolst

    Switching Multiple Related PDFs

    MJMWeb

      I have a table called "Master" with a primary key related to the table "Documents" by a foreign key. "Documents" also has a text field called "name", and a field called "file" which is a container for a pdf.  I need to associate multiple pdf files with a single record so this is my setup. So far no issue. I have a global field in the Master table that is populated with the "name" field from "Documents" that are related to the record. I need to be able to switch which PDF is loaded in the container when the user selects a new file name from the drop down global field. Any suggestions? I can only get it to show the first one (when I don't use interactive mode the files do change based on the "filter" setting, but interactively it just shows the first PDF related to that record).

        • 1. Re: Switching Multiple Related PDFs
          erolst

          You could create a one-row portal into documents that is filtered by the global field.

           

          AFAICR, portal don*t support interactivity; if you need that, create an additional relationship into the Documents table that uses the key fields and matches global against name; put the related container field

          via that relationship on the layout.

           

          MJMWeb wrote:

          which PDF is loaded in the container when the user selects a new file name from the drop down global field.

          Not sure what you mean by “loaded in the container”; your description only includes the container field in Documents. I assume you mean “which related record is targeted to display that record's container”.

          • 2. Re: Switching Multiple Related PDFs
            MJMWeb

            erolst wrote:

             

            You could create a one-row portal into documents that is filtered by the global field.

            I tried that, but I need interactivity which leads us to:

            AFAICR, portal don*t support interactivity; if you need that, create an additional relationship into the Documents table that uses the key fields and matches global against name; put the related container field

            via that relationship on the layout.

            Which works, but only to an extent. The way I am displaying the names in the drop down is through that same relationship. If I make the relationship include the global field connect to the name field, then the only currently displayed filename will be part of the dynamic value list so the users can't select a new one.

             

            Not sure what you mean by “loaded in the container”; your description only includes the container field in Documents. I assume you mean “which related record is targeted to display that record's container”.

            Yes, that's what I meant.

            • 3. Re: Switching Multiple Related PDFs
              erolst

              I need interactivity which leads us to:

              AFAICR, portal don*t support interactivity; if you need that, create an additional relationship into the Documents table that uses the key fields and matches global against name; put the related container field

              via that relationship on the layout.

              Which works, but only to an extent. The way I am displaying the names in the drop down is through that same relationship. If I make the relationship include the global field connect to the name field, then the only currently displayed filename will be part of the dynamic value list so the users can't select a new one.

              "Additional relationship" is the phrase to watch out for 

              • 4. Re: Switching Multiple Related PDFs
                MJMWeb

                erolst wrote:

                 

                "Additional relationship" is the phrase to watch out for

                The additional relationship nerfed the dropdown to only one item. I fixed it by adding a second table that mimicked the Documents table but without the file field. I pulled the dropdown elements from that table and used the original documents table to fill in the related field. Problem solved.

                • 5. Re: Switching Multiple Related PDFs
                  erolst

                  I'm afraid I didn't explain this well enough.

                   

                  Leave the existing relationship as it is, so you still get a value list of related names (and – primarily – still have access to all related records).

                   

                  Create the additional relationship by matching keys and name fields, and display the container from the (presumably) single related record via that relationship.

                   

                  MJMWeb wrote:

                  I fixed it by adding a second table that mimicked the Documents table but without the file field.

                  That sounds … convoluted