3 Replies Latest reply on Mar 15, 2011 9:37 AM by philmodjunk

    Question regarding Table Occurances and Portals



      Question regarding Table Occurances and Portals



      I have a table CONTRACTS

      That is linked to a table FIRMS

      I have a portal on the contracts table that pulls over the firms that are used as subcontracts on the contract.

      The issue I'm needing help with is that sometimes a firm is the actual prime contractor on the contract. I tried placing a field on the CONTRACTS table that was a dropdown using values from the FIRMS table of the firms names, but when I do this whatever I select changes the firms in my portal and the names of the firms in the FIRMS table.

      Do I need to setup another table occurence of FIRMS for this field? If you setup a duplicate table occurance when you add a record to the primary table occurance does it place itself into the secondary occurance too?


        • 1. Re: Question regarding Table Occurances and Portals

          From your Post:  Contracts----<Firms

          seems like you need:


          Contracts::ContractID = Contracts_Firms::ContractID
          Firms::FirmID = Contracts_Firms::FirmID

          That way one Firm can be linked to multiple contracts and a given contract can be linked to multiple Firms. A field defined in Contracts_Firms can be used to identify which Firm is the Prime contractor or a separate table occurrence of Contracts_Firms or Firms can be used to link a record there to a "prime contractor ID" field defined in contracts. (using the contracts_Firms TO here would allow you list a flexible number of "prime" contractors--don't know if that's even possible here.)

          If this looks like what you need. You might download this demo file I've had up for some time that coincidentally matches "contracts" to "companies" in a many to many relationship. You can see how portals to the join table are used to get lists of related records with fields included from both the join table and the other related table.

          http://www.4shared.com/file/PLhjErzu/Contracts_to_Companies.html (Click blue Download button)

          • 2. Re: Question regarding Table Occurances and Portals

            Yes, I have it setup like that and it works fine, but

            What if not inside the portal but if I wanted to have another field on the contracts layout showing FIRMS names. Can I make this happen without interfering with the portal or FIRMS records?

            • 3. Re: Question regarding Table Occurances and Portals

              That's where adding an additional table occurrence to Firms can be used to link to a specific Firm as I mentioned in my last post would come in. You can define a field such as "PrimaryContracterID" and link it to FirmID in this new table occurrence. Then you can format the new field as a dropdown of FirmID's and add fields as needed from this New table occurrence of Firms to list data about the Primary Contractor.