9 Replies Latest reply on Dec 13, 2013 9:26 AM by WarrenPage

    My First Portal:  No Portal Fields Displayed in Layout

    WarrenPage

      Title

      My First Portal:  No Portal Fields Displayed in Layout

      Post

           Hello, I am using FileMaker Pro 12 and need help creating a portal.  This is my first attempt at creating one, so I hope you'll bear with me. 

           A few months ago, I began working on a movie collection database.  I had to put it on hold, and am now getting back to working on it.  The movie database has a few many-to-many relationships, such as directors, actors, and genres. 

           My first portal is going to be for directors. I created a junction table for it, but am not 100% sure I did it right.  Let me first show you the table structure:

      tblMovies
           MovieID (number, auto-enter serial)
           Title (text)

      jnctDirector
           MovieID (number)
           DirectorID (number)

      tblDirector
           DirectorID (number, auto-enter serial)
           DirectorLastName (text)

           My first question:  For the junction table, should I set the DirectorID to auto-enter serial, or not?

           Now…the relationships are as follows:

           tblMovies/MovieID ---->  jnctDirector/MovieID
           jnctDirector/DirectorID ---> tblDirector/DirectorID

           Is this correct?  Now, about the portal…I tried creating a portal using the following tables and fields:

           jnctDirector/MovieID
           jnctDirector/DirectorID
           tblDirector/DirectorLastName

           I'm not sure if that's right.  The problem is this:  In Edit Layout mode, I see the fields displayed in the portal.  When I am in regular Layout mode, and try to enter a new record, the portal is empty.  It does not show any fields, and I cannot enter anything.

           Obviously, I'm doing something wrong.  Not sure what.  Can anyone please provide a tip or two to steer me in the right direction?  Thank you.  Warren Page

            

           PS:  I'd attach a .zip file of the database, but haven't figured out how yet.

        • 1. Re: My First Portal:  No Portal Fields Displayed in Layout
          philmodjunk

               or the junction table, should I set the DirectorID to auto-enter serial, or not?

               No. In the join table, both MovieID and DirectorID must match values generated as serial numbers in the related tables.

               Go to Manage | Database | Relationships. Find the line connecting the Movie table to the Join table and double click it. Now select "Allow creation of records via this relationship..." for the Join table. Now you will be able to go to the movie layout and create new records in the join table by entering data into the fields from the Join table that are in your portal row.

               Format the DirectoryID field from the join table with as a drop down list/pop up menu that shows the Director names from your Directors table but that enters the Director ID's from the same table and you'll be able to create a record in the Join table that links the current Movie record to the existing Director record that you select via this value list of Director names and IDs.

          • 2. Re: My First Portal:  No Portal Fields Displayed in Layout
            WarrenPage

                 That worked.  Apparently, all I neglected to do was enable the portal to add records.

                 I haven't created the drop-down menu yet, because I just wanted to get the portal working.  Now that I know how to do this, I can build on it.

                 Thanks for your help.  W. Page

            • 3. Re: My First Portal:  No Portal Fields Displayed in Layout
              WarrenPage
                   

              Format the DirectoryID field from the join table with as a drop down list/pop up menu that shows the Director names from your Directors table but that enters the Director ID's from the same table and you'll be able to create a record in the Join table that links the current Movie record to the existing Director record that you select via this value list of Director names and IDs.

                    

              I'm not sure how to do this inside a portal.  I tried creating a drop-down menu, but it was layered on top of the portal.  When I tried moving it, it went outside of the portal.  So, are you saying the drop-down menu should be part of the form, and not part of the portal?  If so, then why would I need a portal?  And if you are saying it should be part of the portal, then how do I create a menu inside it?

              • 4. Re: My First Portal:  No Portal Fields Displayed in Layout
                philmodjunk

                     You have these relationships:

                     tblMovies::MovieID = jnctDirector::MovieID
                     tblDirector::DirectorID = jnctDirector::DirectorID

                     On your Movies layout, put a portal to jnctDirector. In the portal row, include the jnctDirector::DirectorID field. Select it and change it from an Edit box to a drop down list or pop up menu on the Inspector's Data tab.

                     Click the pencil control next to the drop down for selecting the control type to create a new value list. Create a new value list with the "use values from a field" option. This opens a dialog where you can select a table occurrence in a drop down and then click a field listed below the drop down to select that field to be used in the value list. Select tblDirector in the drop down and then click the DirectorID field to select it. Since you won't know which director has which ID number, select  tblDirector in the second drop down and select a name field for the second field. (You may eventually want to set up a FullName field that uses an auto-enter to combine first and last names in a single field to use with this value list.)

                     You can then select an option to only show values from the second field so that the value list only displays the Director Names, but enters the Director ID numbers.

                     If you use the Pop Up menu option with this value list, you won't need the Director name field to be added to your portal as it will appear in the DirectorID field. If you prefer the drop down list, you will need to also include the Director Name field from your Director table.

                     This is the "beginner level" approach to setting this up. It isn't the best way to do it when dealing with long lists of values. Other methods can be employed that use scripting and additional design work to produce a more user friendly way to do this, but they all pretty much start from this initial design so it remains a good starting point for getting everything functional before attempting something fancier.

                • 5. Re: My First Portal:  No Portal Fields Displayed in Layout
                  WarrenPage

                       Thanks for replying and for the help.

                       Your instructions worked, but I am encountering one more problem.  I created the drop down menu, which works.  However, I added some names to the Director table.  I closed the database, closed down FileMaker, opened it up again, and tried creating a few more test records.

                       The directors' names I added to the tblDirector table do not show up in the drop down menu.  Only the names I entered prior to creating the portal appear in it.  What can I do about that?

                       Thanks again.

                  • 6. Re: My First Portal:  No Portal Fields Displayed in Layout
                    philmodjunk

                         No part of creating the portal would cause that result. Better check your data in the Directors table. Your relationships and this drop down require that you have unique values being automatically entered into the DirectorID field for each new record--usually this is done with an auto-entered serial number. Make sure that the new records have values in this field. You will also need unique values in the name field. If you create two records that have the exact same text in the name field used in the value list, no value for the second record will appear in the list.

                    • 7. Re: My First Portal:  No Portal Fields Displayed in Layout
                      WarrenPage

                           Well, something's wrong, because I deleted all of the records in all three tables and started from scratch.  Now, I'm not even getting a drop down menu at all.

                           I'm going to have to figure out how to solve this problem, because once the database is complete and I start entering data, I'll be adding new data, of course, over the course of time.  And there will be three portals to deal with, not one.

                           Let me dabble with it, and see what I can come up with.  If I knew how to attach a file, I would, and maybe you or someone else could spot something obvious and simple that I'm not experienced enough to see on my own.

                      • 8. Re: My First Portal:  No Portal Fields Displayed in Layout
                        philmodjunk

                             To repeat, check the values in those two fields. They should not be empty and the values in them should be unique in each director record. The ID field should also be indexed, but it's unlikely that it's not indexed unless you changed a setting on the storage tab in Field options for that field.

                        • 9. Re: My First Portal:  No Portal Fields Displayed in Layout
                          WarrenPage

                               Okay, I got it working properly, and am able to add names.  I'm not 100% what went wrong.