3 Replies Latest reply on Sep 15, 2014 6:25 AM by philmodjunk

    How to associate one record to another

    JohhnyHilly

      Title

      How to associate one record to another

      Post

      I have a table called Properties that stores information on each property I have. I would like to add to my database to record all bills that I incur, and associate each bill to the respective property. 

      To do this, I was originally thinking to create a layout based on Property table, with a portal from Bills table, but I realised this won't work because I don't want to create numerous bills for one property, instead I am wanting to create numerous bills, then assign it to a property. To do this how will I setup the tables and what table will the layout be linked to?

      Thanks in advance.

        • 1. Re: How to associate one record to another
          philmodjunk

          How i s using the portal different from "create numerous bills, then assign it to a property"?

          The two most commonly used methods are to use a portal, or to set up a layout based on the portal's table (Bills) and use a value list formatted foreign key field to select the associated property.

          Another method being used more and more is to start from a layout based on property. A script copies the property record's primary key to a global variable. You then switch to a Bills layout and create records where an auto-enter calculation copies the value of the global variable into the foreign key field of the new Bills record each time you create a new record.

          None of these options precludes any of the others and you might use all of them in the same database.

           

          • 2. Re: How to associate one record to another
            JohhnyHilly

            Thanks Phil. The way I thought it worked is that if you have a layout based on Properties, and a portal on Bills, when you create a new Bill record it will automatically appear under whatever Property record it was created for?

            Anyway, your second suggestion was what I am after. Thanks for that.

            • 3. Re: How to associate one record to another
              philmodjunk

               Yes, but how does that create a difference for you when you use the database?

              The only difference between the two options when it comes to the process of linking records is that the portal does it automatically at the point where you start filling data into fields. It's often much more convenient for users to do it that way.