5 Replies Latest reply on Apr 10, 2013 1:20 PM by philmodjunk

    go to portal row stuck on first row

    dmorgan

      Title

      go to portal row stuck on first row

      Post

           Hi,

           Trying to pull email addresses from a portal and GTPR Next just goes back to the first record.  

           that part of the script is

           Go to Object[named portal]

           Go to Portal Row [Select; First]

           Loop

           If 

           and Else If's

           to put the email adress in to the right field based on another field

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

           End Loop

           I'm using advanced so I see it working in debugger but it just keeps looping back to the first row.

        • 1. Re: go to portal row stuck on first row
          philmodjunk

               is there more than one portal on the layout?

               IS there a commit record step in your looping script?

               Go to Portal Row depends on the focus and the current portal row will lose the focus each time commit record is performed. There are two alternatives you can consider:

               1) Use Go To Related REcords to pull up the portal records in a found set on another layout. Use go to Record to loop through the values there.

               2) Use List ( Portaltable::field ) to put a return separated list of these values in a variable. Then loop through the values in the variable instead of looping through the portal row.

          • 2. Re: go to portal row stuck on first row
            dmorgan

                 Thank you,

                 The script inserts text into a field so yeah that was stealling focus from the portal, that about drove me nuts.

                 I can't use option one this is a very large exsisting db and the relationships are overwhelming.

                 I solved it by getting last row number as a variable which is the blank next new record and then decriment that value everytime through the loop and GTPR[$rowcount] then exit the loop at 0 $rowcount

                 I'll have to look at List function as I haven't worked with it yet, might not work as I'm filtering where the address go by another portal field but I'll test it out.

                 Thank you again 

            • 3. Re: go to portal row stuck on first row
              philmodjunk
                   

                        I can't use option one this is a very large exsisting db and the relationships are overwhelming.

                   Sorry, but I don't understand why that's a problem. You can use the relationship defined to make the portal work with Go to Related records to bring up a found set of records on another layout. No extra relationship need be added to your database.

                   A better approach is to not insert the data into the field. Use set field instead and you won't be changing the layout focus. (And set field can be used to insert data into existing text in a field--though it's more complex than with an "insert..." script step.

              • 4. Re: go to portal row stuck on first row
                dmorgan

                     I tried option one and it wouldn't copy the information across layouts for some reason, and after trying to fix that went with the portal rows instead.

                     I'll try set as well, thank you for all the quick and useful help.

                      

                      

                • 5. Re: go to portal row stuck on first row
                  philmodjunk
                       

                            and it wouldn't copy the information across layouts for some reason,

                       Feel free to describe that in more detail. Since you have a relationship between the two tables, you should be able to reference data in the parent record with no trouble, but the table occurrence of the layout you change to could be source of trouble here if it's not the same table occurrence as that used in portal setup for the portal.