3 Replies Latest reply on Jul 7, 2014 10:23 AM by philmodjunk

    Auto fill author name when title is selected



      Auto fill author name when title is selected


           It would seem easy to do but I'm not figuring out how to


           I have a layout for class profiles it has a portal using the table LibraryBook

           LibraryBook::Title in the portal is defined using a drop down list value list of the field LibraryBook::Title. It is working find. What I like to do is auto fill the portal author's name with LubraryBook::AuthorFullName

        • 1. Re: Auto fill author name when title is selected

               If your portal is to LbraryBook, how can you also look up data such as the author's name from the same table?

               Seems like you need a third table here:


               I used my own names here to make clear the nature of each table. You would have one record in TableOfBooks--which might be your library books table, for each book title in your library. Fields from TableOfBooks can then be included in the portal to portalTable to show information, such as a book title and author name about the book selected in a drop down list in the portal.

          • 2. Re: Auto fill author name when title is selected

                 Sorry Phil, but i'm not understanidng your reply. I don't understand exactly how the table LibraryBook which is the portal's table differs from the Portal Table you refer to and what fields would the 'Portal Table' consist of.

                 My layout table is ClassProfile and my portal table is LibraryBooks

                 The relationship is ClassProfile::_pkClassId----------<LibraryBook::_fkClassId

                 Portal has two fields LibraryBook:Title & LibraryBook:AuthorFullName. There are numerous other fields in the table LibraryBook but I'm wishing to show only the two fields in the portal

                 Objective is when I select LibraryBook::Title in the portal using a drop down list to have LibraryBook:AuthorFullName auto populate

                 I select LibraryBook:Title within the portal and the object is defined to use a drop down value list which is defined to use LibraaryBook::Title as its source of data


            • 3. Re: Auto fill author name when title is selected

                   It's the "selecting" part that doesn't work and I can't see a way for it to work given your current table/relationship design.

                   If the author and title are stored in a record in LibraryBook, from where are you looking up this data? It doesn't make sense to me to look up this data from the LibraryBook table when it is also the portal table where you are "selecting" a book.

                   Thus, I am recommending that you have two tables: TableOfBooks would be a table where you have exactly one record for each book in your libarary. Fields in this table would record the title and author Name(s).

                   PortalTable, which I would rename "selectedBooks" for this more detailed explanation, would have one record for each book selected for a given record in ClassProfile. This enables you to select the same book for more than one ClassProfile record. The "look up" would then be a case of looking up this info from the TableOfBooks table into fields of your SelectedBooks table, or better yet, you'd just put fields from TableOfBooks into the portal row of your SelectedBooks portal to show the author names and book title. This is then a classic many to many relationship.