4 Replies Latest reply on Feb 22, 2012 5:34 AM by CharlesVogan

    Find and display a related field



      Find and display a related field


      Help!  I'm brand new at this. 

      I figured out how to set up a layout for our school class schedule for the year, and I even figured out the drop down list!  That's about as far as I can get without getting into exotic stuff, right?

      What I can't figure out is how to get that classID to go out to the related field from the classes file and bring back the class name, and write it on the screen where I have the xxxx's. Does this involve a script? Variables?  Triggering?  All this is new to me, and I can't figure it out from any directions I've looked at.  Supposedly I can get that field - but displaying it is beyond me. 

      Step by step directions for a novice, please? If I can do this, I'm home free.


        • 1. Re: Find and display a related field

          I assume that ACC 401 is your classID field.

          If you have this relationship:

          LayoutTable::ClassID = Classes::ClassID

          where "layout table" is the table occurrence specified for your layout and "Classes" is the table where we'll find the class name, then what you need is simple to do. (if the listed classes shown are in portals, use the Portal's table instead of the layout's in the above relationship.)

          Enter layout mode.
          Use the field tool to add a new field to your layout next to the ClassID field.

          The specify field dialog appears. Select Classes (use your name instead of mine), from the drop down at the top.

          click your class name field to select it and then click OK.

          This has added the name field from the related table to your layout and it should then show the correct class name for each listed record.

          • 2. Re: Find and display a related field

            Ah yes!  Getting closer!  I was linking the wrong fields.

            But now there's a new problem.  How does each new Class Name field know to trigger off the Class ID that it's sitting beside?  When I enter the first Class ID, all the Class Name fields get the same value in them - no matter what the rest of the Class ID's end up to be. 

            I tried linking the rest of the Class ID fields to the Class file (like I did the first one), but then I get nothing for Class Names - it's as if they all get blanked out when I select a Class ID. 

            Actually it's not essential that I have a field on the layout for the Class Name.  All I need to do is display text with the name in it; since the Program file has Class ID's in it, and that links to the Classes file, why would I need to put extra fields for Class Names in it when they're readily available (theoretically)?

            I hope all this is clear ...

            • 3. Re: Find and display a related field

              The problem lies with the structure of your table. You should not have multiple classID fields, only one. The individual fields should be replaced by individual records in a related table--which can then be displayed here in a portal.

              It may also be possible to set up a list view layout where each row of Class ID, Class Name and Semester drop down is a separate record and the text above the first row is all located in the header. The "first year", "second year" headings can then be placed in sub summary layout parts.

              With either approach, you have a single ClassID field to link to your Classes table.

              To make this work with your current structure, you'd have to make multiple occurrences of your class table and link each occurrence to a different ClassID field in the table of the layout shown above. That can work, but is very inflexible and produces a very complex relationships graph.

              • 4. Re: Find and display a related field

                OK - I've hit the wall here.  Time to go study portals!


                Thanks for your help!