7 Replies Latest reply on Apr 24, 2015 10:41 AM by rouelf_1

    Portal: Navigate through records vs using vertical scrollbar

    ryan9721

      Title

      Portal: Navigate through records vs using vertical scrollbar

      Post

      Hi all,

      I have a question about Portals. I have no problem getting a portal to show related records as selected by a dropdown box. However, I want to show only 1 record at a time in a form-like view (each record shown in the portal is a Survey response, so it includes both scoring columns and comment columns) with previous/next/first/last navigation and a "create new" button.

      By making the Portal the size of the page and selecting show only 1 row at a time, I've somewhat accomplished this goal. However, to see additional records you have to use the vertical scrollbar which is a little cumbersome. Is there a way to add previous/next/first/last navigational arrows to flip through each record instead? I would also like to add a button to "create new" record (so someone could create a new survey right from this form).

      Is this all possible with a Portal, or should I be using a different method?

      Thanks!

      -Ryan

        • 1. Re: Portal: Navigate through records vs using vertical scrollbar
          Sorbsbuster

          Is that not just viewing all the related records in a standard Form View layout in their own table?

          • 2. Re: Portal: Navigate through records vs using vertical scrollbar
            ryan9721

            Hi Sorbuster, thanks for the response.

            Here's an overview of the project: We are conducting customer surveys. On the left side of the layout is the "Contact" selection. A user can select a company name from a dropdown, and that auto-populates another dropdown to include all contacts for that company (we work with multiple contacts from each company that need to be surveyed). Upon selecting a Company and Contact, that person's personal information (address, email, etc.) displays in the form.

            Since we regularly survey customers many of these Contacts have multiple SurveyResults associated with their account. The SurveyResults consist of both rating numbers and comment boxes. On the right side of the layout I would like to be able to review past survey results (one at a time) and then create and enter information into a new survey.

            Thanks!

            -Ryan

            • 3. Re: Portal: Navigate through records vs using vertical scrollbar
              Sorbsbuster

              I get that ok, I think, but my question still stands: why is that not just browsing through the list of related records, in their own table, in Form View?  What you have explained is the neat interface to getting to that found set of related survey records.  At the final point of selection (hitting the specific Contact name) instead of only showing the related surveys in a portal, why not use Go To Related Record to go to the surveys table and show those records in form view.

              • 4. Re: Portal: Navigate through records vs using vertical scrollbar
                philmodjunk

                It's possible to script this using a portal filter to control which record is visible in the portal. This technique uses a utility layout to keep track of which portal record is "next" or "previous" and requires FileMaker 11 and an auto-entered serial number in the portal's table.

                Set up your portal with this filter expression (Substitute your table occurrence and field names for mine):

                $$SerialID = PortalTable::SerialNumberField

                Use an OnRecordLoad script trigger to run this script:

                Freeze Window
                If [IsEmpty ( PortalTable::SerialNumberField ) /* portal is empty */ ]
                   Go To layout ["UtilityLayout" (PortalTable)]
                   Show All Records
                   Show only omitted
                Else
                   Go To Related Record [Show only related records; From table: PortalTable; Using layout: "UtilityLayout" (PortalTable)]
                   Go To Record/request/page [first]
                   Set Variable [$$SerialID ; PortalTable::SerialNumberField]
                End If
                Go To Layout [original layout]
                Refresh Window [flush cached join results]

                Now you create your navigation buttons to update $$SerialID to step through the portal records one record at a time
                Here's the script for "Next Portal Record". Very similar scripts can be created for Previous, First and Last Record buttons.

                Freeze Window
                Go To layout ["UtilityLayout" (PortalTable)]
                Go To Record/requst/page [next]
                Set Variable [$$SerialID ; PortalTable::SerialNumberField]
                Go To Layout [original layout]
                Refresh Window [flush cached join results]

                • 5. Re: Portal: Navigate through records vs using vertical scrollbar
                  AlexSachsen

                  I understand what is being said here... but i find myself having to do special scripts for a whole lot of thing and I personally do not believe one should have had to do that much work just to bring up the next portal row.... sadly the goto portal row only selects the next portal row (highlighting it) , instead of bringing it up in to view... 

                  So that being said... the answer to your question Ryan, the next portal row is in fact being highlighted, which you would see if you scrolled down (after enabling the vertical scroll bar), but because you are not changing which record is the 'first' record in the first portal row, and you are in fact viewing only the first related record in the first portal row, you will not see a change on your screen...

                  I went as far as to put which portal row was selected out of a total of how many... this kinda helps you know which one is selected, however, buttons only work on active portal rows.... 

                  Furthermore, what you are describing is a webdirect or IWP issue... the simple next or previouse button work when using FMP client on a desktop or laptop...but as you may have noticed you have to have scroll bar enabled for it to work... strange i know... thats why an all around good solution to the problem that will work for everything is described by PhilModJunk, thanks for that btw :-)

                  Sorbsbuster - in answer to the why not just go to related record.... i can't answer that without a picture... meaning it would be alot more work to go to the individual item just to go back to the parent table form view 

                   

                  Good Luck All... Happy DBAing

                  • 6. Re: Portal: Navigate through records vs using vertical scrollbar
                    JavierRodriguez

                    Hi

                    O also have the same issue. I tried Phimodjunk technique but that gets me into a never ending loop.  The routine keeps firing since it get activated by the OnRecordLoad event. Any help willbe appreciated. 

                     

                    • 7. Re: Portal: Navigate through records vs using vertical scrollbar
                      rouelf_1

                      After resizing the portal to show one record:

                      I use six buttons:
                      1) 1st Button, runs a script, name: First:
                          step 1: Go to Object [Object Name: "WebPortal"]
                          step 2: Go to Portal Row [Select; First]

                      2) 2nd Button: runs a script, name: Last:
                          step 1: Go to Object [Object Name: "WebPortal"]
                          step 2: Go to Portal Row [Select; Last]
                          
                      3) 3rd Button, runs a script, name PrevPortalRow:
                          step 1: Go to Object [Object Name: "WebPortal"]
                          step 2: Go to Portal Row [Select; Previous]
                          
                      4) 4th Button, runs a script, name NextPortalRow:
                          step 1: Go to Object [Object Name: "WebPortal"]
                          step 2: Go to Portal Row [Select; Next]
                          
                      5) 5th Button, runs a script, AddRecord

                      6) 6th Button, runs a script, DeleteActiveRow