I think this is what you want: You can set this up with a script so that clicking a record in portal 1 selects the records to be shown in portal 2. Thus, clicking a class record in portal 1 would show the list of students assigned to that class.
You have at least three tables/table occurrences
Main (what your layout is based on)
Classes (portal 1)
StudentClasses (portal 2, probably a join between Classes and students)
Presumably theres a primarykey field in Classes called ClassID or some such and a matching ClassID field in StudentClasses.
Define a global field in Main, gClassID
Use it to relate Main to StudentClasses (you may need a new TO for StudentClasses)
Main::gClassID = StudentClasses2::ClassID (Base portal 2 on this specific TO)
Write a script
Set field [Main::gClassID; Classes::ClassID]
Commit Record //May not be needed, add it if portal 2 doesn't refresh properly
On your layout define the class name field in portal 1 as a button and specify this script.
Use conditional formatting on this field (or all the fields in the portal row)
Classes::ClassID = gClassID
and specify a contrasting color.
Now, when you click the field in Portal 1, it should highlight and the matching student list for the class should appear in portal 2.
Thank you for the quick reply. I will try to digest this and make it work. I may have to come back with some questions, but it makes sense so far, at least conceptually.
That was it! Thank you very much.