2 Replies Latest reply on Feb 28, 2015 2:04 PM by Musoguy

    Getting a related record from an Nth record

    Musoguy

      Title

      Getting a related record from an Nth record

      Post

      Hi folks, I seem to be a little stumped! I'll simplify the solution I am working on to try and make sense. I have three  related tables A, B and C. A is related to B in a one to many relationship and B is related to C in a many to one relationship. I am trying to retrieve a field's data from table C whilst in table A. However the record I am trying to find belongs to the second related record in table B. I can get hold of that record using the GetNthRecord function, but is there then a way to get the related record in table C from this record? I hope that made sense. Thank you so much in advance for any replies.

      James

       

       

        • 1. Re: Getting a related record from an Nth record
          philmodjunk

          A---<B>----C. This makes B a typical "Join" table.

          There are several options. How do you determine that it will be the second record? If you have a button in a portal to B on the A layout, Go to related records can bring up this record on a Table C based layout. It may, in some cases take to GTRR steps, one to isolate the correct B record on a B based layout followed by a second to isolate the C record, but I would only try this if a single GTRR to C fails to work for you.

          You can also establish different relationships using a different occurrence of C linked to a different match field in A. You use Go To Nth Record to access the Primary key value of the related C record and set this additional match field to that value to link the current record in A to the desired record in C via this added Tutorial: What are Table Occurrences?.

          • 2. Re: Getting a related record from an Nth record
            Musoguy

            Thank you for the response, very helpful. The information isn't being accessed through a portal, it's a script that fires dependent on the field in the "C" table. Your second solution will work in this situation though. Thank you, I just needed a set of outside eyes as I couldn't see the wood for the trees. Thanks again for your help :)