2 Replies Latest reply on Aug 2, 2012 10:01 AM by JanMoreland

    Using multiple portals for one main record

    JanMoreland

      Title

      Using multiple portals for one main record

      Post

       The record I am working with has three log-tag fields that each have many related records associated with them. I am using the portal views to display all three groups of related records (which works fine) but I have a script that reads through each set of records to perform calculations. If I select the script for the first portal, it works great. However, when I get to the second portal view and my script does a 'go to the first portal record' it goes back to the first portal. Is there any way to force the script to see and use the second or third portal? I am using a screen with tabs. The first tab(s) display fields from the main record and I have three tabs that display each portal view. On each of the portal view tabs, I have a button to perform a script. Even though I execute the button/script from the second portal view tab, the 'go to first portal record' goes back to the first set of records.

        • 1. Re: Using multiple portals for one main record
          philmodjunk

          I recommend NOT interacting with portals using go to portal row if there is a reasonable alternative. It can be done, but such scripts are very "hardwired" into the layout's design and thus is more vulnerable to "breaking" due to future layout changes than with alternative approaches that produce the same results without using go to portal row.

          To do this with out go to portal row, you freeze the window, then use go to Related records to pull up a found set of the portal records on a layout based on the portal's table. If the portal is filtered, follow up with a constrain found set that drops out the same records the portal filter excludes. You can then use a loop with Go to Record/Request/Page [next ;exit after last] instead of go to portal row to loop through the same data.

          The main draw back to this approach is that if you have any script triggers such as OnLayoutExit, OnLayoutEnter, onRecordLoad on either of the two layouts, this script will trip them and this can cause unexpected results. There are ways to disable the trigger controlled scripts to avoid this.

          If you do use a go to portal row script, first enter layout mode, select the portal object and then enter an object name for it in the Name box at the top of the Inspector's position tab. Then your scripts can run like this:

          Go To Object ["ObjectNameHereInQuotes"]
          Go To Portal Row...

          The Go to Object step puts the focus on the correct portal object so go to portal row will interact with the correct portal. If the script is identical except for the portal, you can pass the object name as a script parameter and use the same script for all three portals.

          • 2. Re: Using multiple portals for one main record
            JanMoreland

             Thank you - I appreciate your help!