[SalesForce] display list of cases related to contact on service console left sidebar

We have email-to-case enabled and I have created a console to manage the cases and using custom console components, I am trying to display a list of cases related to a contact.

I am trying to achieve this list in the console.
Cases List in Console
I am unfortunately unable to replicate the same list from another Org to the Org I am working on. It was developed by a different vendor and has a lot of code. Is there a method to display related cases to a contact in the service console component?

I came across a small code which displays the case list based on Contact ID. I created a VF page and had this code in it and created a custom console component and used this VF page there.

Code used:

<apex:page standardController="Case">
<apex:relatedList list="Cases" subject="{!Case.ContactID}"/>
</apex:page>

I am getting this error message in the console for the code I have used and we are currently using Person Accounts. I am Admin and cannot write code. Please help.

Error message:
Error message in Side Left Bar in the Console

Best Answer

The issue you're having is related to the nature of person accounts. A person account takes most of the information from contacts that aren't on the account object and adds it to the account detail page; duplicating it in the database. If you have account record types other than person accounts, you'll want to check the contact's record type before you attempt to display your related list.

If the only type of Accounts you use for Cases are person accounts, then what you'll want to do is change your list to the account object for that contact since each contact will only have one account. If that's your situation, it actually would be preferable to use the accountId rather than the contactId to track your cases. I recognize that's not the normal way cases and the console are configured to operate. Perhaps if you do some additional research on person accounts, you may find a solution for this particular issue that's out of the box since it's clearly the cause of your problem.

Related Topic