4 Replies Latest reply on Jan 4, 2013 12:55 PM by Stephen Huston

    Related Record Problem


      I've been scratching my head over this and can't figure out what is wrong. I have a layout based on a Task table. There is a portal with a child table of Task Personnel. The task Personnel table records are selected from the Contacts drop-down list and contain the ID of the associated Contact Record. The Event Contact information and related Contact information display fine in the portal. I have a button in the portal to go to the related record in the Contacts layout. In the Contacts layout I see all of the related Task Personnel Contact records instead of the one record I selected in the portal. The GTRR specifies related record only. Am I missing something obvious?



      Here are the relationships:


      Parent Tasks

      Child Portal Task Personnel (related by Tasks ID)

      Related Record in Portal Contacts Table Occurrance (related by Child Contact ID)

        • 1. Re: Related Record Problem

          One other thing I did not mention. I am using the same tables and relationships on another layout (for Events) and on that layout the GTRR works as expected. The layouts have only minor differences. They both run a script to bypass the record commit script and then contain the GTRR script step.

          • 2. Re: Related Record Problem
            Stephen Huston

            The GTRR step with ONLY RELATED RECORDS option still takes to to ALL of the related records, not just the one you clicked on. However, the one you clicked on should be the active record if you are in list view, assuming the button was fully within the portal row of that record on the starting layout.


            Unchecking the ONLY RELATED will take you to a set of all records, not just the related ones, but, again, should leave you on the active record for the row you picked.


            HOWEVER!!!  If you are using a Commit Records step, you may be effectively losing the focus of the portal record on which you clicked. If you want to do that but still control the record on which you land, you can set a variable to the ID of the record in the portal while in the script (BEFORE the commit step so you have focus on the target record), then, after the GTRR on the new layout, go to first record, then loop going to next record with an exit loop option at the top of the loop to exit the loop if the $variable matches the record ID. This will stop you on the intended record.

            • 3. Re: Related Record Problem

              Thanks Stephen. Your 'HOWEVER' solved the problem. As you suggested, the reason that all of the contact records related to the Task were in the found set instead of the one related to the Task Personnel portal record was that I always set a flag in the Task record to force a commit. And as you pointed out, I lost focus on the portal target record.


              On the Events layout, where I thought things worked as expected, I did not force a commit of the Event parent record so I did not lose focus of the portal target record. However if I did update the Event record, it forced a commit and the found set of contacts again resulted in the records related to the Event parent record and not the Task Personnel portal record.


              Again, thanks for your help in solving my conundrum. I could have spent a very long time trying to figure this out.


              • 4. Re: Related Record Problem
                Stephen Huston

                christopherc wrote:

                I could have spent a very long time trying to figure this out.



                I know I spent a long time on it when it first bit me. Some script steps just seem to surprize us by not doing what we want.