2 Replies Latest reply on May 6, 2014 11:33 PM by AdamRoberts

    Foreign Key

    AdamRoberts

      Title

      Foreign Key

      Post

           I have just starting using filemaker so please be patient with this very basic question. 

           I have two tables, Clients (with a ClientPrimaryKey) and Programs (with a ClientForeignKey) . I am having issues populating the "ClientForeignKey". Is there a way that when I add a new client "name" in the Program Table, that the foreign key in that table can automatically populate with the ClientPrimaryKey from the Clients table, The field "Name" exists in both 

            

           Any advice I would be most grateful 

            

        • 1. Re: Foreign Key
          philmodjunk

               Remove the client name field from Programs. This is an unneeded field and can create issues should you ever need to edit a given client name.

               In the Client to Programs relationship, enable "Allow creation of records via this relationship" for clients.

               Put the Name field from clients on your programs layout. If you create a new record on the programs layout and enter a client name, FileMaker will a) create a new record in Clients, b) generate a value in ClientPrimaryKey (assuming that it's an auto-entered value such as a serial number) and c) copy that value to the ClientForeignKey field in programs.

          • 2. Re: Foreign Key
            AdamRoberts

                 Thanks very much, that made it all clear