Is it possible to create custom views for a particular record that will include details on related fields?

For example, I have a Student object and a Course object, and then I have a StudentCourseRelationship object that represents a Student having a relationship with a Course. This Relationship Object has some fields like completed which is a boolean.

With this data, I would like to create a view related to the student that would display:

  • Student Information (all my custom fields)
  • A list of the student's StudentCourseRelationships where completed==true
  • A list of the student's StudentCourseRelationships where completed==false

In simpler terms, StudentCourseRelationship is suppose to represent any Course a Student has enrolled in at one point or another, and in the Student View, I want to display both a list of the student's completed courses and a list of the student's incomplete courses.

Is this possible? Everything I research related to custom views leads to a custom object's Page Layout (single record) or creating a custom List View (single object).

EDIT: A more complicated example of where I will need to use such a Layout View:

I have an Advisor object. I have a Student object that has a Gender look up field and an Advisor look up field. I have a Match field that has look up fields to Student and Career.

Advisor --> Student Gender --> Student Student --> Match <-- Career

How could I create a view/report that, for a single Advisor Record would show me:

How many times each `Career` record has been "Matched" to a `Student`, broken down by the student's gender?

Accounting: 10 Matches to Male Students, 30 Matches to Female Students
IT: 30 Matches to Female Students, 10 Matches to Male Students

Is the only possible way to do this through a Visual Force page? Could this be done through Reports (grouped reports don't seem to work as I originally expected)?

  • 1
    As long as you have a Parent/Child relationship between your objects, you can achieve it using Filter Related Lists without Code.
    – Jayant Das
    Feb 18 '19 at 20:24
  • This seems like a way to filter lists automatically, not a custom view for a record's related objects...
    – BlondeSwan
    Feb 18 '19 at 20:33
  • I thought you were looking for that, isn't it? I want to display both a list of the student's completed courses and a list of the student's incomplete courses
    – Jayant Das
    Feb 18 '19 at 20:35
  • 1
    And that's what the blog helps to achieve. The example there is with Account/Contact relationship, but is applicable to any Parent/Child relationship. So as long as you have the Student and StudentCourseRelationship as Parent/Child (which seems you have set it that way), you can achieve it the way explained in the blog.
    – Jayant Das
    Feb 18 '19 at 20:43
  • 1
    I added the contents from comments, as an answer to your question.
    – Jayant Das
    Feb 18 '19 at 21:17

From comments:

My whole question was whether or not this is possible... so VisualForce pages are my answer?

This is possible, but using some customization. At times when we exhaust the options what are available to us out of the box, we could utilize the customization route.

In your case, you can either utilize the configuration only route if you are only looking for a filtered list view as mentioned in Filter Related Lists without Code by @Doug Ayers.


If you don't want to utilize the option as in the link, your options depending on the view you are in Classic vs. Lightning, are to create custom screens using:

  • Visualforce pages
  • Lightning Aura Component
  • Lightning Web Component
  • I was able to figure out that Visualforce Pages, Aura Components, and Web Components can be added to a record's Page Layout, so thanks for that tip. Now, if I'm on a certain Student record, can you set up your VF Page or Component to "take in" the current Student record? Like, can you pass the current student record (or Id) to the component so that you can have the component be custom for that user? Sorry for my unfamiliarity to SF, it's all new to me.
    – BlondeSwan
    Feb 18 '19 at 23:36
  • I guess, is a Lightning Component or a VF Page better equipped to take in variables?
    – BlondeSwan
    Feb 18 '19 at 23:38
  • @BlondeSwan Yes you can. As an example you can have interface say force:hasRecordId on an aura component which directs the component that it has a record id, and use that component on the record page. I will definitely recommend to take some trailhead for more information. That’s a good place to get started on this topic.
    – Jayant Das
    Feb 18 '19 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.