0

I have a problem I can't solve.

I'm recording the relationships between Mentors and Mentees.

We capture 'matches' via Look Up Fields.

enter image description here

I can only see this match in List view on the Mentee side.

On the mentor side, it's in the Related List.

enter image description here

How can I get a field to autoupdate with the Mentee so I can view all the matches in List View from the Mentor side? ie to be displayed in a list like this:

enter image description here

  • Can you post a picture for better understanding – Santanu Boral Nov 9 '18 at 11:58
  • Thanks Santaun - I'll edit the original questions with some examples – James Powell Nov 9 '18 at 12:05
  • Ok Santuanu - I've added examples – James Powell Nov 9 '18 at 12:11
2

As a general rule, you cannot show the "many" side of a one-to-many relationship like this on a list view on the "one" side. Why? Because there's many values, and it's not clear what the right way to show that would be in a list view context, where what you expect is one row per record. Salesforce doesn't have native modeling for one-to-one relationships.

Note that you can do this in a report, and you'll get what you might expect if you have SQL joins in your head - as many rows for each Mentor as that Mentor has Mentees, with the Mentor information repeated for each Mentee.

If what you're working with is actually a one-to-one relationship (i.e., each Mentor will only ever have one Mentee, full stop), you can use a Process Builder automation. You'd attach it to the Mentee object, and configure it to update a "Mentee" link on the "Mentor" every time the Mentee is updated. Then you'd actually have a field on the Mentor that you can show in a list view.

Contrariwise, if what you have is more like a many-to-many relationship, it may be that the right data model for you is a junction object: a record representing the match itself, with master-detail relationships to both the Mentor and the Mentee. Your list views could be built on this Match object, and would show the details of both Mentor and Mentee - as well as any other metadata you chose to add to the match, like its active dates or status.

Keeping the data model you have and not treating it as one-to-one, the only route I can see to get this information in a list view is to use Declarative Lookup Rollup Summaries to populate a Text field on the Mentor with a concatenated list of Mentees' names. You can do this with a rollup in the "Concatenate Distinct" mode.

  • Thanks David - this is a really helpful answer - As always with SF there's a lot of complexity when you ask for something which appears simple! The relationship actually changes year by year so a Mentor will work with different Mentees over their their years working with us - this is why we capture the data in a Related List. Thanks for your detailed reply, I'll work on a resolution with it. – James Powell Nov 19 '18 at 14:57
  • @JamesPowell Based on that, I would strongly recommend you utilize a Junction Object, which will allow you to track metadata (like Year) for the relationship. – David Reed Nov 19 '18 at 16:23

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.