2 Replies Latest reply on Feb 29, 2012 7:09 AM by huntert

    Company and Pricing Relationship - need help

    huntert

      The overrall goal is to have Companies within the database to be able to price Material for each BuildingType. Then from the company perspective be able to select a BuildingType to filter a portal and be able to view the list of Materials that they priced for that BuildingType with their price next to each Material.

       

      So we load the database with a couple of Companies, Some Material, and a couple of BuildingTypes (ex, A, B, C).

       

      BuildingTypes can have many Materials linked to them but a piece of Material can only be linked to one BldgType.

      Material can be priced by many Companies and many Companies can price more then one piece of Material.

       

      So I figured my primary tables would have to be as follows: Material, BuildingType, Company.

      To resolve the many to many between Companies and Materials I would need a join table called CompanyMaterialPrice. The fields of this table would be _kf_Company, _kf_Material, Price.

       

      I also created a TO called buildingtype_MATERIAL for the one-to-many relationship. This allows me to list the Materials related to a BuildingType in a Portal from the BuildingType perspective.

       

      This is where I get confused. I believe I am creating the right tables. I just don't think I am creating the correct TABLE OCCURENCES to make everything link together.