12 Replies Latest reply on Aug 16, 2013 7:33 AM by davehob

    GTTR from portal record

    user19036

      Hello,

       

      In the portal records of my layout are the "Transactions" child table to the Parent table the Layout is based on.

      One of the fields in the Transactions portal has a field from a table that is also a parent to my Portal table (Transactions), but is not the Table that the layout is based on. I want to make a button within the Transactions Portal row that performs a script that takes me to a Transactions based Layout showing all File-Wide transactions that include this related field (this field is in a table that is a Parent to the Child table that my portal is based on.

       

      Thank You!

       

      Darryl

        • 1. Re: GTTR from portal record
          keywords

          If I understand correctly you basically want to use GTRR to navigate to one of the records in the portal, on a new layout. If so, you could add a portal row button to activate a script which:

           

          1.     captures the record ID of that portal record (save as a variable)

          2.     navigates via GTRR using the relationship the portal uses to the layout you specify

          3.     finds the specific record using the variable

           

          You should be able to format the layout you are now on to include fields from any other related tables.

          1 of 1 people found this helpful
          • 2. Re: GTTR from portal record
            erolst

            keywords wrote:

             

            If I understand correctly you basically want to use GTRR to navigate to one of the records in the portal, on a new layout. If so, you could add a portal row button to activate a script which:

             

            2.     navigates via GTRR using the relationship the portal uses to the layout you specify

             

            … and to the record that represents the portal row you clicked on, which GTRR does automatically if you perform the step within a portal row  – which makes step 1 and 3 unnecessary.

            • 3. Re: GTTR from portal record
              keywords

              Thanks erolst. Always learning!

              • 4. Re: GTTR from portal record
                user19036

                Guys,

                 

                Thanks for your responses!

                 

                When I do a GTTR, and check the  "Show only related records" and "Match current record only" it gives me all the Transaction records related to the original layout parent table.  Another way of saying it is that "Match current record" it thinks I want to match the current record of the original layout, and ends up showing me exactly what I'm seeing in the portal, (just in another layout that I choose based on the portal table.)

                 

                I want all the Transactions records related to another table that is parent to the portal table.

                 

                Thanks for your help!!

                 

                Darryl

                • 5. Re: GTTR from portal record
                  keywords

                  In FileMaker's logic:

                   

                  "Match current record only" means the current record in the parent record you are currently on, and

                  "Show only related records" means any record which is related to that record (ie. all the records in the portal)

                   

                  So perhaps you do need my steps 1 and 3 after all, in order to find only the portal row record you selected (even though GTRR, as erol pointed out, will navigate you to that record within the found set of all the related records).

                   

                  As to your last point, I want all the Transactions records related to another table that is parent to the portal table, I'm not quite clear on what you mean. Is the record in the first portal itself a parent to other records? Or is it a child record connected to some other parent?

                  • 6. Re: GTTR from portal record
                    erolst

                    If I understand this correctly: you're originally on tableA and have a portal for tableC (the transactions).You then click on a given portal row, which is also a child to some tableB, and want to see all transactions of that tableB record.

                     

                    You can use a variant of what keywords suggested: GTRR, then capture the value of foreignKeyB in a variable, Enter Find Mode, Set Field, Perform Find ( or use Find Matching Records).

                     

                    For completeness' sake: If you create another TO of tableC and connect it to the TO of your target layout via foreignKeyB=foreignKeyB, you could then do a GTRR to that new TO (while still using the other layout).

                     

                    Don't forget error checking; you know that the record from tableC exists, because you clicked it in the portal; the same must not necessarily hold for the existence of any foreignKeyB. This is where, depending on your workflow and/or business rules, you might want to check if a) the portal row record even has a foreignKeyB, b) there are other children of that B key.

                    • 7. Re: GTTR from portal record
                      flybynight

                      Maybe I'm missing something, but shouldn't it just be a matter of selecting the right layout in your GTRR script step? Borrowing the hypothetical table names from erolst, it sounds like your GTRR step is taking you from tableA to the related records in tableC, which is your portal… but you actually want to be viewing the records related to that one in tableB. Is tableC a join table with the parents of A and B?

                       

                      I guess I haven't actually done it myself, but I just assumed that you could hop more than one "step" in the relationship graph using GTRR. If not, then sounds like erolst's plan of creating another TO is the way to go.

                      Or you could GTRR, do the find thing to isolate the 1 record (the one with the button in your original portal), then do another GTRR to get you the rest of the way to tableB.

                       

                      Good luck!

                      -Shawn

                      • 8. Re: GTTR from portal record
                        erolst

                        Shawn –

                         

                        while Darryl's description might not be the most illuminating, I still think I gathered from his (last) post that he was talking about that tableB field in the tableC portal, where tableB is a “parent” table to tableC, and then all the other tableC records belonging to that tableB record.

                         

                        Or in more concrete terms: tableA: order table; tableB: products table; tableC: line items; on the order layout is a line items portal, where in each portal row you see the respective product (say, a FileMaker-branded coffee mug).

                         

                        I think Darryl does not want to go to the coffee mug record in the products table, but instead see all other line items where the product in question is that coffee mug; and this is where my suggestions comes into play; and you could indeed do a 2-table hop if you had said self-join TO.

                         

                        But then again, I could be totally wrong about what Darryl is asking …

                        1 of 1 people found this helpful
                        • 9. Re: GTTR from portal record
                          user19036

                          Guys,

                          Thanks so much for your responses!!

                          YES - Erolist has it exactly right in terms of what I wanted to do.

                          I'm gonna try to implement the script he described now!!!

                           

                          Darryl

                          • 10. Re: GTTR from portal record
                            wsvp

                            An additional consideration, when using GTRR from a portal...

                             

                            When GTRR is performed (without any additional action) "from a portal", it will find all the records in that portal.  This can be a big problem, particularly on the Windows platform.  In Windows, the scroll wheel on the mouse will cause FileMaker to navigate from record to record, "Even in Form Mode"...  The result is that many users accidentally edit the wrong child record.  I personally never use GTRR for this purpose/reason.

                             

                            GTRR is great when you wish to find a set of matching records from a set of multiple records.

                             

                            As a side note, I wish we could set GTRR dynamically, Like the current function "Set Field By Name" this would really make the GTRR step far more useful.

                            • 11. Re: GTTR from portal record
                              user19036

                              For completeness' sake: If you create another TO of tableC and connect it to the TO of your target layout via foreignKeyB=foreignKeyB, you could then do a GTRR to that new TO (while still using the other layout).

                              I did exactly that and it worked like a charm! Once you've connected the two TableC TO's, the script is one step GTTR, (plus a sort, if you need it... which could be done with a script trigger on the layout.)

                               

                              Thanks!!!!

                              • 12. Re: GTTR from portal record
                                davehob

                                One thing that can help here is a separate TO.  For example, if you are using the "magic key" technique to create child recs from the portal (i.e. to create a child rec when it doesn't already exist), you can use the same "create" relationship for going to an existing child rec. - the GTRR will only find one record.

                                 

                                That said, if you haven't got such a relationship set up, or the circumstances are otherwise unsuited, the method of storing the key and then doing a Find is probably the better bet.

                                 

                                And yes, I agree that a "dynamic GTRR" would be great!

                                 

                                Dave.