8 Replies Latest reply on Mar 24, 2015 12:13 PM by dang

    Relationships created - what now?

    dang

      Title

      Relationships created - what now?

      Post

      There is a great 3 part tutorial on how relationships work, turning a many to many relationship into linked one to many, etc. But I can't figure out what is next. Or what search terms to use to figure out what's next.

      I'm working on a student/class database. (There's even an example of the relationships for a student db used in the relationship tutorial). Now that I have my relationships set up, classes entered, and students entered, how do I let filemaker know that a student attended a class? I'm sure I shouldn't have to manually attach the student id to the class id.

      The invoices database that is often used as an example works great, but there is SO MUCH going on with it that I can't figure out what's doing the basic work.

      Does someone have an incredibly simple relational database that automatically joins two items so I could tinker with to see how it works? Or a couple search terms that I should be using to learn the next step. I'm assuming somewhere it has to do with portals or look ups? Any help would be very, very appreciated.

      Thanks!

        • 1. Re: Relationships created - what now?
          philmodjunk

          But we can't see or know what tutorial you referred to in order to set up your relationships. We can't see your relationships either.

          So it is not clear what "next step" you need nor from what current design you would be taking that step.

          I recommend using Post A New Answer to respond with a more complete description of your current design and what you are trying to do.

          If you've already discussed this with me or someone else here, it would be simplest to find that thread and use Post A New Answer for follow up questions so that others can see what has gone on before in order to better be able to help you.

          • 2. Re: Relationships created - what now?
            dang

            Thanks! I apologize. This is the tutorial: http://help.filemaker.com/app/answers/detail/a_id/3248/related/1 It's a 3 part series. If there was a "now read this item to see what to do next" I'd be off and running.

            I didn't give much input on MY database as I didn't feel it was anyone's job to do my work for me, especially at this stage in my learning. I created a database with 3 main table (Students, Certifications, Training) (attached).

            I'm just looking for ANY example of joining a couple items (i.e., putting 2 types of vegetable on 1 invoice) (putting 2 students in 1 class). I'm currently stuck at looking up and remembering the primary key of a student and the primary key of a class and putting them together in a joined table. This obviously isn't the right way to do it. So far, when I've created a portal, none of my sample data appears in the portal. I'm doing something wrong, I just don't know what, and can't figure out where to start.

             

            • 3. Re: Relationships created - what now?
              philmodjunk

              Yes, but we have to see your current design before we can help you with that next step.

              I see two typical many to many relationships with two join tables all linked in a "chain".

              There are many possible next steps from here. What do YOU want to do next with this? Much depends on the work flow you need to support with your database. You may even find that the "conceptual" relationships shown aren't what work best when you go to design layouts that are hopefully easy to use and which minimize the chance for user errors.

              • 4. Re: Relationships created - what now?
                dang

                http://cfwampuscats.com/wp-content/uploads/2015/03/Training%20Test.fmp12

                I've uploaded the file here. I don't know if there is a preferred way of providing a file. I appreciate the help. I ordered a book today to hopefully help me get started.

                 

                • 5. Re: Relationships created - what now?
                  philmodjunk

                  Looking at your file doesn't really answer the question of what you want to do next. 

                  • 6. Re: Relationships created - what now?
                    dang

                    In the NOTES table I tried to explain.

                    I simply want to know how to put a Student in a Training class. I don't understand HOW to do that even though the tables are joined.

                    **And it could be that I don't know how to ask the question correctly. In my mind the question is quite simple and I figure I'm fairly foolish for not figuring it out. On the other hand, you feel I'm obtuse for not asking the right question. If I'm asking the question wrong, I'll try to figure out the right question to ask.

                     

                    • 7. Re: Relationships created - what now?
                      philmodjunk

                      Putting a student into a training class requires creating a new record in Attended_Join with values in the two fk fields that link it both to the correct student record and the correct training class record.

                      Now that I've stated the obvious wink, let's look at what probably isn't obvious to you, the mechanics of how to do that. There are multiple options so I'm going with the simplest "beginner level" approach, but if you find that this isn't fully to your liking, keep in mind that it's not the only option.

                      First, double click the relationship line be between Attended_Join and Student_Information to open up the relationship details dialog. Click "allow creation of records via this relationship" for Attended_Join. Click OK to save this change and close the Manage | database | window. Now find your Student_information layout and use the portal tool to add a portal to the layout. Select Attended_Join from the "show Related records from" drop down. Add at least these fields to your portal: fk_Training and Training::Title. You might want the description field from Training in your portal row as well.

                      Now adjust the field sizes and positions in your portal row to suit your needs. Make sure that after all such adjustments, the objects inside the portal row still move when you move the entire portal. Select the fk_Training field and use the options in the Inspector's data tab to turn it into either a drop down list or pop up menu.

                      Click the pencil icon for creating a value list. This opens the Manage | Value Lists dialog box where you can create a new value list. Create a "use values from field" value list and select Training from the left drop down. Then click pk_Training in the list of fields that appears below it. Now click the "also use..." check box and select "Title" in the second list of fields. Leave it like this for know so that you can see what happens better when you use/test this value list, but you may want to come back later and click the check box that will hide the pk values and only show the training course titles in your value list. You should also experiment with the different options in the Inspector--especially the drop down list and pop up menu options to better see what your options are.

                      But now you can save your changes, enter browse mode and for the current student on your layout, you can select as many courses as desired using this drop down list or pop up menu. When you select a course in the drop down, you should see the field or fields from Training automatically populate with data form that record in the Training table.

                      These steps assume that you have correctly set up your pk field in training to auto-enter a unique ID and that you have created at least a few records in Training with the title and (if you used it) description fields filled out. Also, the names in Title must be unique for each record in Training.

                      Once you have that working, you might want to explore ways to improve on that basic value list which can get a bit cumbersome when your list of training courses becomes fairly long. You might check out the Adventures in FileMaking series. Adventures 1 and 2. They are free to download.

                      Adventures in FileMaking #1 - Conditional Value Lists (includes details on how to set up a basic field based value list)
                      Adventures in FileMaking #2 - Enhanced Value Selection (what to do when a simple value list won't cut it.)

                      Caulkins Consulting, Home of Adventures In FileMaking

                      • 8. Re: Relationships created - what now?
                        dang

                        PhilModJunk, Thanks! This is exactly what I needed. I followed your instructions and it worked (added classes to a student). I tried following it again to do it "backwards" (adding a student - hopefully, later multiple students at once - to a class) but haven't gotten it going yet. That's okay, I want to *learn* this, not just follow step by step instructions, so I'm going to play with it more and read a lot more first. 

                        I just wanted to respond and say thanks for getting me started!