10 Replies Latest reply on Feb 3, 2017 6:22 AM by rgordon

    Portal - Make it scroll to make focused be on top

    Stigge

      Hi Guys

       

      Am guessing this is a noobish question. =)

       

      When i enter my form that has a portal i always show a "related" record in the portal. I have it focused and all,  but i want it to be on top row in the portal, not sorted or anything, just scrolled so its at the top.  Is that possible ?

       

      I have tried to go to Portal Row, with calculation Get(ActivePortalRowNumber) and done a "+15" after followed by a Refresh Object, but that didnt work.

      Is there anything else i can do ?? =)

       

       

      Thanks

        • 1. Re: Portal - Make it scroll to make focused be on top
          mikebeargie

          For portals, navigation order is:

          -Go to the portal [object]

          -Go to the row

          -Go to something on that row

           

          So something like:

          Go To Object [ "NameOfYourPortal" ]

          Go To Portal Row [ First ]

          Go To Field [ PortalTable::SomeFieldOnPortal ]

           

          I'm not sure but I thought any refresh actions need to be before portal navigation because refreshes kill context.

           

          If you want to go to the top portal row though, using "first" is what you need. I'm not sure what your "+15" or checking the active row is for.

          • 2. Re: Portal - Make it scroll to make focused be on top
            IT_User

            This is so that they don't have to scroll down the last portal row to enter in new information?

            Having the empty portal row to enter in information would be nice, but not an existing feature. (There may be ways to get around it.)

             

            Instead of go to Portal Row with a calculation

            Use:

            Go to Portal Row [Last]

             

            and I don't think a Refresh Object is needed. (It actually might reset which portal row is shown.)

            • 3. Re: Portal - Make it scroll to make focused be on top
              Stigge

              Let me show instead. (Blacked out information do to sensitive information)

              This is when i enter the layout, it is a portal, with ofcouse alot of stuff around. but only this is relavant to my question.

               

              This is how it is: (See where the line is marked)

              How it is.jpg

               

               

              This is how i want it: (Se where marked line is located):

              Should be.jpg

              • 4. Re: Portal - Make it scroll to make focused be on top
                mikebeargie

                First, why is this NOT a list view?

                 

                Given the scroll bar on the right, you are trying to page through the portal. In which case you would need to use Get(ActivePortalRowNumber) like so:

                 

                Set Variable [ $row ; Get(ActivePortalRowNumber) - 15 ] //SUBTRACT to go UP, ADD to go DOWN.

                Go To Portal Row [ number by calculation ; $row ]

                Go To Field [ PortalTable::SomeFieldOnPortal ]

                • 5. Re: Portal - Make it scroll to make focused be on top
                  philmodjunk

                  Mike is asking a very good question, but assuming that you have a very good reason to use this portal...

                   

                  Another person here in the forum showed a very clever way to put a blank "add row" at the top of a portal:

                   

                  Make a copy of this portal and reduce it to one row in size and put it at the top of your portal. Use a portal filter that omits all records where the primary key or foreign key field is blank so that all existing records do not show in the portal and only the "add row" shows. You can then enter data into that blank portal row to add new records.

                   

                  I used to recommend a set of global fields across the top of the portal with an "add" button that uses a script to create the new portal record, but this is a simpler approach as no scripting is needed.

                  1 of 1 people found this helpful
                  • 6. Re: Portal - Make it scroll to make focused be on top
                    Stigge

                    Hi Mike

                     

                    Am not using a list view becouse am having loads of "shit" on the side aswell, like edit fields, calculations etc. only took a screenshot of the relavant part.

                     

                    Tryed yout code

                     

                    Its showing the correct row number, but its just not showing my line am having active on top. what am also guessing with this code is that its activating another row, but thats not what i want,  i want the active row to be scrolled so its located at top of my portal, not sorted.

                    The reason for this is that on the sides i have options that changes the values in the row, and i want the user to see them as they are changed. by having the portal showing row 1, and having row 245 as active isnt really helping when they cant se it.

                     

                    Thank you.

                    • 7. Re: Portal - Make it scroll to make focused be on top
                      Stigge

                      Hi IT_User

                       

                      This is not a case of adding a new line to the row, its viewing already existing for editing.

                      example:

                      - rows total: 400

                      - User want to change line 61, then i want row 61 to be scrolled so its on top of the portal. not sorted or anything, just scrolled.

                      • 8. Re: Portal - Make it scroll to make focused be on top
                        BruceRobertson

                        Not gonna happen. Pointless.

                        Figure out what you really need to do.

                        • 9. Re: Portal - Make it scroll to make focused be on top
                          philmodjunk

                          Try using go to portal row to scroll to the last row, then use go to portal row to scroll back to the row that originally had the focus.

                           

                          You might also use a script to set a field in the parent record to the portal record's primary key, then use a relationship based on those two fields and a new occurrence of the portal's table to put a row of fields just above the portal to show the data from the current portal row.

                           

                          I'd also look into coming up with ways to reduce the amount of records that are visible in the portal at any given time such as giving the user a control that lets them select one category of records at a time.

                          • 10. Re: Portal - Make it scroll to make focused be on top
                            rgordon

                            Assuming that you portal has 20 rows the following script should put the record at the top of the portal

                             

                            Set variable [$row; Value: Get (ActivePortalRowNumber)]

                            Go to Portal Row [dialog off ; $row + 20]

                            Go to Portal Row [dialog off ; $row ]

                             

                            Also in the Portal Setup to make sure Reset Scroll Bar When Exiting Record is unchecked.  This will keep the portal from refreshing.