1 Reply Latest reply on Jan 31, 2014 6:50 AM by philmodjunk

    Creating Relationships

    AndrewLiddell

      Title

      Creating Relationships & linking them to other tables????

      Post

           Hi Guys,

           Can someone please help?

           What I want to do is create relationships so that if I input the information into one table the information is automatically inputted through all my report layouts.

           I am trying to create a lifting database that I can use onsite. I have three report layouts and I need all the same information such as client, job number & inspection date to be on all three reports.

           Can someone please explain this as I am having a complete nightmare achieving it.

           Thanks in advance.

        • 1. Re: Creating Relationships & linking them to other tables????
          philmodjunk

               I have no idea what a "lifting database" might be so the answer that I am about to post will not be a detailed example based on your project but a generalized example of how relationships work in FileMaker:

               Say that you have two tables linked in a relationship:

               Clients-------<Projects

               Clients::__pkClientID = Projects::_fkClientID

               __pkClientID would be defined as an auto-entered serial number in most FileMaker projects though that is not the only option. _fkClientID would be a simple number field in that case.

               When you create a new record in Projects and You or FileMaker enter a matching number from Clients::__pkClientID in ordert to link that new record to a specific Clients record, any fields from Clients that you put on the Projects layout will automatically display data (such as the client name) once a matching value has been entered into _fkClientID.

               There are a number of ways that you can facilitate linking a Project record to a client record. A portal to Projects on your clients layout can do this autmatically each time you enter data into the blank "add" row that appears in the portal if you enable "allow creation of records via this relationship." _fkClientID, on the other hand can be set up as a drop down list or pop up menu such that it displays client names, but enters the client ID. And there are also ways to set up a script that copies the ID of the current client record into a global $$Variable and then an auto-enter calculation set up on _fkClientID can enter the value. If you examine the starter solutions of FileMaker 12 or 13, you can find examples of all three methods.

               You can also use the relationships to physically copy data from one table to a related record in another table. I wouldn't do that for Client Name in the above example, but it's a good way to look up things such as product prices or hourly rates as that way you can then change the looked up value and previous records that copied over the value won't update--which is a nice way to handle price/rate changes in a database.

               See this thread for a more detailed discussion of how a relationship can be used with either method (copying or just displaying the related record's data):Auto Fill

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

               And if you really want to take your understanding of how relationships work in FileMaker to the next level, see this thread: Tutorial: What are Table Occurrences?