You need to sign in to do that
Don't have an account?
Solution Custom Fields referenced in Case-centric Email template
Hi,
Looking through the support data model, you can see that cases and solutions are linked via a junction object, CaseSolution.
I've got a custom field on the solution object (lets call it solution.custom__c).
For Cases, we often want to send an email template which includes information about any solution attached to the case. I've noticed that when the email template is related to object 'Case' only Solution Description and Solution Details are available to me through the email template field drop downs and none of our custom objects are available. I assume this is due to the junction object.
So, my question, is there any reliable way for me to delve a little deeper into the fields of any given solution? Basically I want to build an email template related to cases which can reference custom fields of any solution which is attached to the case.
Any help would be greatly appreciated!
I ran into the same kind of requirement - here is my code that you can modify to suit for custom fields.
Controller code to search for Solution details based on a CaseId passed in (with test method at the end):
Then I build this component to display the Solution details returned. My template is in plain text so I didn't use a dataTable component or anything fancy that doesn't work in plain text.
And finally I included this component into my visualforce Email Template:
The only downside of this is you can't include the Solution attachments. We can query for them in the controller but I don't see a way to attach them into the email template. I added an Idea for that - vote if you think it would be useful.
You can add any custom fields you need into the controller query.
Hope that helps.
Niki
www.vankerksolutions.com