Forum Discussion

BethanyHudson's avatar
BethanyHudson
Qrew Trainee
5 years ago

Many to Many

I need to create a field(s) that allows me to select multiple records. Here's my tables and relationships: Activities & Contracts - I've got two relationships between them: Activities->Contracts and Contracts->Activities

Right now I want to be able to select which Contracts are associated with a certain Activity via the Activities table. I'd also like to eventually be able to select which Activities relate to a certain Contract via the Contracts table.

------------------------------
Bethany Dickey
------------------------------
  • Right, so you need a vanilla many to many relationship setup, but your set up is incorrect.  If you have no real data in those existing two relationships, then delete the relationships and start over as I will describe.

    But if you do have a lot of data loaded, then we can late migrate the data as to which goes with which.

    Make a new "middle" or "join" table called Contract Activities with no fields.

    Make the Relationship were One Contract has Many Contract Activities.  Be sure to set up a proper Proxy field such as Contract name for the field [Related contract]. 

    Make the Relationship were One Activity has Many Contract Activities.  Be sure to set up a proper Proxy field such as Activity name for the field [Related contract]. 

    On the Contracts record form, put the field for Add Contract Activity and also the embedded table for Contract Activities and set the report to show on the form.

    On the Activities record form, put the field for Add Contract Activity and also the embedded table for Contract Activities and set the report to show on the form.

    Congrats, you are now a Many to many expert,.  Thats's all there is to it.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • BethanyHudson's avatar
      BethanyHudson
      Qrew Trainee
      Awesome! Everything worked. Now how would I go about assigning certain amounts from a Contract Amount field to each activity?
      --


      ------Original Message------

      Right, so you need a vanilla many to many relationship setup, but your set up is incorrect.  If you have no real data in those existing two relationships, then delete the relationships and start over as I will describe.

      But if you do have a lot of data loaded, then we can late migrate the data as to which goes with which.

      Make a new "middle" or "join" table called Contract Activities with no fields.

      Make the Relationship were One Contract has Many Contract Activities.  Be sure to set up a proper Proxy field such as Contract name for the field [Related contract]. 

      Make the Relationship were One Activity has Many Contract Activities.  Be sure to set up a proper Proxy field such as Activity name for the field [Related contract]. 

      On the Contracts record form, put the field for Add Contract Activity and also the embedded table for Contract Activities and set the report to show on the form.

      On the Activities record form, put the field for Add Contract Activity and also the embedded table for Contract Activities and set the report to show on the form.

      Congrats, you are now a Many to many expert,.  Thats's all there is to it.

      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      mark.shnier@gmail.com
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        np, just add a field onto that join table Contract Activity called [Amounts].  Then you can make a summary field if you like to summarize the total of Amount and call the field  [Total Amount].    You make the summary field on the left side of the relationship where One Contract has many Contract Activities.

        If you want to be able to add or edit children in Grid Edit mode, the on the form properties for the embedded table, check the box to allow grid edit.   That way when you edit the Parent you will be able to edit the Contract Activities.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------