2 Replies Latest reply on Nov 13, 2013 7:58 AM by GustavoPenaVerplancken

    Get a value from a related table's, related table.

    GustavoPenaVerplancken

      Title

      Get a value from a related table's, related table.

      Post

           I'm new with FM so I'm having trouble figuring how to do this:

           I have a table called "PaymentTerms" that has my payment term options and the number of days, for example "NET15 / 15"

           I have a table called "Supplier" that is related to PaymentTerms via "__fk_PaymentTerm"

           I have a table called "Purchase" that is related to Supplier via "__fk_Supplier"

            

            In a layout based on the "Purchase" table, i would like to display the Days value from the "PaymentTerms" table and also use it on calculations based on the related "Supplier" record.

            

           Any help MUCH appreciated.

        • 1. Re: Get a value from a related table's, related table.
          philmodjunk

               It appears that these are your relationships:

               Purchase>------Supplier>------PaymentTerms

               PaymentTerms::__pk_PaymentTerm =Supplier::__fk_PaymentTerm
               Supplier::__pk_Supplier = Purchase::__fk_Supplier

               If those are your relationships, you can put fields from PaymentTerms on your Purchase layout and they will display the desired data. You can also define either Calculation fields or data fields with auto-enter calculations that can refer to fields from PaymentTerms.

          • 2. Re: Get a value from a related table's, related table.
            GustavoPenaVerplancken

                 @PhilModJunk - Thanks! 

                 After I read your post I figured out why it wasn't working for me... The way that I had my relationships setup, i didn't have a connected relationship that included all 3 tables, I had it split into two parts w/ 2 instances of the Supplier table on the Relationship view. My setup was:

                 Supplier>---PaymentTerms

                 Purchase>---Supplier_Purchase ("Supplier")

                 Once I changed it and tied it all together, it worked.

            Purchase>------Supplier>------PaymentTerms

                  

                 Many thanks.