3 Replies Latest reply on Sep 16, 2013 9:33 AM by philmodjunk

    Using a calculated or looked-up value in a portal

    JohhnyHilly

      Title

      Using a calculated or looked-up value in a portal

      Post

           I have two portals on a layout. The first portal has a list of equipment (table equipment list) and when you click on one, it brings up the service history of that piece of equipment in the second portal (table service history, where I can then enter data, in particular the Total Running Hours of that equipment).

           My issue is, certain equipment have the same Total Running Hours as others. For example, the Main Engine and Gearbox will both have the same TRH since they operate concurrently. Is there a way to take the TRH of the Main Engine and have it automatically appear in the TRH of the Gearbox?

           Bear in mind there are other equipments where the above does not apply so I still need to have the TRH field free to enter data for those ones.

        • 1. Re: Using a calculated or looked-up value in a portal
          philmodjunk

               Oh my, what a challenging question!

               It's definitely possible and I can picture several different approaches. I'm not at all sure which will work best for you.

               One option is to move TRH into a related table. Then multiple items of equipment can be linked to the same TRH record (or just 1). Just what you needed, another related table right? But such is the nature of relational database design...

          • 2. Re: Using a calculated or looked-up value in a portal
            JohhnyHilly

                 Haha yes challenging alright and absolutely, really wanted another related table :)

                 Is the one above you described the simplest and easiest?  Would I make a new table occurence of Service Histroy (child table) and join it to the Equipment_List (parent) table? How would I make the connections so the above is possible? 

                 The other thing is I have table occurences of Service History (say SH1, SH2, and SH3) that are connected to Service History, so by taking TRH out of the main Service History table and putting it in a related one, will that effect SH1, SH2 and SH3?

                 I am a little worried this might be a little too much for me to handle.

            • 3. Re: Using a calculated or looked-up value in a portal
              philmodjunk

                   I think it's probably the most straight forward way to handle this. Your TRH table can have an auto-entered serial number field to uniquely identify it and then you can link any given equipment record to it by assigning the __pkTRHID value to it's _fkTRHID field. This implements a "many to one" relationship.

                   so by taking TRH out of the main Service History table and putting it in a related one, will that effect SH1, SH2 and SH3?

                   It could, depending on the needs of your system, you may end up with multiple occurrences of the TRH table so that you can link it in to each of these service history occurrences. (But note that you can link this to the equipment record rather than the SRH record.)