7 Replies Latest reply on May 23, 2013 5:58 AM by applelakshan1

    Loop Sript that tuns via portal

    applelakshan1

      Title

      Loop Sript that tuns via portal

      Post

           Hello experts, 
           I have solution that included 3 tables, 01 Contact,  02. email Camp, 03. email camp users 

            

           01. All the Contatcs 
           02. All the emai camps 

           03. All the users on specifc email camp 

           **How it works on the email camp layout, user can see 2 portals, 


           01.  portal shows contacts  (portal a)
           02. portal that shows the selected contacts to that email camp (portal b)

           Now i have created script that copy the contact  from portal a  to portal b (each portal row have button to run the script),  that works without any problems, but once i have more than 50  clients on portal  a that will be time consuming job to run the script manually for each client.

           instad of that i want to loop script that add all the records on the found set of  portal a 
            

           The Problem 
           When i run the script that i have written, its always copy the first record on portal A and it does not  go to the 2nd record of the on portal a.  

           I want to run the script and it copy all the list in to portal b from portal a and exit loop after the last record on found set.

           Thanks in Advance for your help.

            

           al1

            

            

            

      Screen_shot_2013-05-19_at_5.17.39_PM.png

        • 1. Re: Loop Sript that tuns via portal
          philmodjunk

               I would guess that your "pushthisrecord" script loses the focus on a specific portal row in your portal. Perhaps it includes a commit records step or changes records or layouts.

               You may need to keep track of the current portal row in a variable or use Go To Related  Records to pull up the portal records in a found set on a different layout in order to loop through the related records instead of the portal rows.

          • 2. Re: Loop Sript that tuns via portal
            applelakshan1

                 Hello Phil, i just went thrugh it, and some improvement there:), 

                 But now there is another problem,  now it go to 2nd record on portal  and copy that one  but not going to third one , Im attaching the Pushrecord script step.

            • 3. Re: Loop Sript that tuns via portal
              applelakshan1

                   I have attached the problem that i have  mention on my previous comment

              • 4. Re: Loop Sript that tuns via portal
                philmodjunk

                     As I speculated in my previous post, the "pushthisrecord" script loses the focus in the portal where you are looping through records.

                     Personally, I would neither use Insert calculated result nor loop through portal rows to do this.

                     I'd either pull up found sets of records to loop through or use the List function to generate a list of the values from the related table in which to loop through. This avoids the need to keep re-establishing the focus on a particular portal row in each portal.

                     And I'd use set field instead of a script step that starts with "insert". Those steps require that the target field be present and accessible on your current layout or they silently fail and this is not an issue with set field.

                     But if you choose to loop through your portal rows, you can re-establish the focus like this:

                     Set Variable [$Row ; value: Get ( ActivePortalRowNumber ) ]
                     Perform Script ["PushThisRecord"]
                     Go to Object [ "Specify object name of correct portal here in quotes" ]
                     Go To Portal Row [$Row; no dialog ]

                • 5. Re: Loop Sript that tuns via portal
                  applelakshan1

                       Hello Phil, Thanks a lot for the time :). I made the modification on the script, and i found that the loop always running to first record on portal a (the light orange color portal)

                       Then i change it to

                  Set Variable [$Row ; value: Get ( ActivePortalRowNumber ) ]
                  Perform Script ["PushThisRecord"]
                  Go to Object [ "Specify object name of correct portal here in quotes" ]
                  Go To Portal Row [$Row; no dialog  +1]
                       
                       after i did that it switch to the second record  and after the second it went to 3rd  etc (that is what actually im after ) . But  at last looping  starts again, so i was end up like 
                       
                       A,B, C,D, A, B,C,D, A,B, C,D   , any idea how to stop the loop ? screenshot attached 

                  • 6. Re: Loop Sript that tuns via portal
                    philmodjunk

                         Exit Loop If [ $Row > Count ( PortalTable::NeverEmptyField ) ]

                    • 7. Re: Loop Sript that tuns via portal
                      applelakshan1

                           Thanks Phil :)