7 Replies Latest reply on Jan 20, 2015 8:09 PM by user19752

    I come back to the last activated portal row?

      Hi there,

       

       

      I habe a layout with a certain tab and in it a certain portal. I loop through that portal. While looping I have to leave that layout, do some search and other things in another layout - and want to come back and "land" on the activated portal row to delete this one.

       

      For that I named my objects anf the script comes back to the right layoutm the right tab and also the right portal object. But the portal row is NOT activated.

       

      It seems that I can activate it by using the "go to next row" step but this doe not work in my case (why? I check for certain portal rows to doe something and then delete that ro. If I do not have to do something on that row and do not delete it - this step leads to the wrong row).

       

      Hwo do I activate the "left" portal row t which I want to come back?

       

       

      Thanks,

      Luna

        • 1. Re: I come back to the last activated portal row?
          erolst

          You asked more or less the same question in that other post.

           

          When you return to your layout, the portal doesn't know anything about the row you left.

           

          You could …

           

          • before leaving the portal, capture the portal row number in a $var; on returning, go to the portal object, then Go to Portal Row [ by calculation: $rowNumber ].

           

          If your script deleted that row, you'll land on the row that was the next before you left (if there is still such a row number), which may or may not be what you want in your script logic. If it didn't, and you want to continue the loop, you could of course directly go to $rowNumber + 1 …

           

          • do whatever you need to do to/on the related record from the context of the portal row (if that is feasible; hard to tell without knowing what “other things in another layout” exactly are

           

          • forego the portal; instead, go to the set of related records that are displayed in your portal and perform your loop in that found set, then return

          • 2. Re: I come back to the last activated portal row?

            Yes I know... And I know that I can loop thorugh the portal. But hope it

            could be easier. I have put the Get (ActivePortalRow) into a variable

            but how do I apply this correctly to the portal-object after returning

            to it?

             

            Am 20.01.15 um 12:50 schrieb erolst:

            • before leaving the portal, capture the portal row number; on

            returning, go to that row number.

             

            • 3. Re: I come back to the last activated portal row?
              wimdecorte

              use the Go To Portal Row script step

               

              If you have multiple portals on the layout, you will need to use Go To Field [ any field in the portal ] or if you have named objects you can use the Go To Object script step

              • 4. Re: I come back to the last activated portal row?
                erolst

                You need to

                 

                # while in a portal row

                Set Variable [ $rowNum ; Get ( ActivePortalRowNumber ) ]

                # leave the portal to do other things

                Go to Layout [ original ]

                Go to Object [ "YourPortalObjectName" ]

                Go to Portal Row [ by calculation: $rowNum // + 1 to go to next in loop ]

                 

                Consider the other suggestions that were made; looping through a portal while leaving the layout and returning to the portal is probably not the most efficient way of doing whatever it is you're doing.

                • 5. Re: I come back to the last activated portal row?
                  jlamprecht

                  erolst wrote:

                   

                  • forego the portal; instead, go to the set of related records that are displayed in your portal and perform your loop in that found set, then return

                   

                  This is going to be your best solution in my opinion based on your other post regarding performance. If you are staying on that layout with multiple portals (One being all companies in the database) and looping through it, that is a cause of some of your performance woes.

                   

                  Get off that layout and perform your functions on a blank layout based on the context you need.

                  • 6. Re: I come back to the last activated portal row?
                    debi

                    Luna,

                     

                    If you want to come back to the same row/same portal record, I recommend against grabbing the row number, as that could change by the time you return. Instead, grab the primary key of the record in the portal row, and loop through the rows until you've got a match.

                     

                    HTH,

                    debi

                    • 7. Re: I come back to the last activated portal row?
                      user19752

                      If you don't leave portal, you don't need to back.

                       

                      //Go to Portal Row [Select; First]

                      Loop

                      Go to Related Record [Show only related records; From table: “portal”; Using layout: “portal” (portal); New window]

                      If [Get ( LastError ) = 0]

                      #do the job on new window

                      Close Window [Current Window]

                      End If

                      Go to Portal Row [Select; Next; Exit after last]

                      End Loop

                       

                      This is simple, but creating window on every loop may be slow. If "the job" has any user interaction, not matter.