3 Replies Latest reply on Apr 13, 2010 1:44 PM by Jade

    Using Relationships

    AviDavis

      Title

      Using Relationships

      Post

      Hello I started another Thread but it appears I need much more basic help. 

       

      I'm very new to filemaker pro 10 on Windows Vista. My target idea is to create a database that contains these three tables: Organization, Representative, and Donor.

       

      My Idea was this. In one layout include all three tables to be able to edit and add new records in each table. In the Organizations layout I created a tabbed control tool for representative and donor.  In each tab I included a portal to to their respective tables.

       

      In the Organization table I created two key fields: representativeID and donorID. next I added representativeID and donorID to the corresponding tables and drew a line connecting the organizations key field to the foreign field, establishing a relationship. I then adjusted the settings to allow for creation of new records.

       

      There must be something very basic that I'm missing because simply what I'd like to do is, in one layout create multiple records in each table. For example I'd lke to add two donors to one organisation but for some reason a new portal row will not appear, so I think it's a script issue. Then I think that the relationship is not set up right because the new portal row should be automatic.

       

      I really hope someone can help because I seem to have hit a wall. Thank you everyone for reading this.

        • 1. Re: Using Relationships
          Jade

          I'll assume for now that one Organization can have many Representatives and many Donors.

           

          The Organization table should have an auto-enter serial key, OrganizationID.

           

          Both the Representative and Donor tables should have a numeric, foreign key OrganziationID.

           

          Your relationships should be drawn from Organization::: OrganizationID to Representative:: OrganizationID and from Organization:: OrganizationID to Donor:: OrganizationID

           

          After you have this part working, you should ask yourself if the representatives can work for more than one Organization.  Similarly, can a donor give to more than one Organization?  If your answer is yes to either or both of these questions, then you might have to use "join" tables to handle the many-to-many relationships.

          • 2. Re: Using Relationships
            AviDavis

            This is very helpful information, Jade. Thank you for your help, I will create this organizationID field and have it automatically entered as a serial. With the donorID and representativeID I already have them as automatically generated numbers, is this correct? I will look into the join tables as per your advice. :)

            • 3. Re: Using Relationships
              Jade

               

               


              Avi Davis wrote:

              … With the donorID and representativeID I already have them as automatically generated numbers, is this correct?


              Yes; donorID should be in the Donor table and representativeID in the Representative table.  You will need these id's later when you implement the join table(s).  (For now, I would recommend that you get it working without the join tables.)

               

              I think your initial problem was that you had the relationships backwards (i.e. you were linking one representative to many organizations rather than the other way  round).