You need to sign in to do that
Don't have an account?
I need help creating a visual force email template.
Hi,
I'm trying to create a VF template for cases that will include the related Solution (from the Solutions related list on Cases).
I am getting an error: "Error: Invalid field Solution__r for SObject Case"
The code is as follows:
<messaging:emailTemplate subject="Test VF" recipientType="Contact" relatedToType="Case">
<messaging:htmlEmailBody>
<html>
<body>
<table border="0" >
<tr>
<th>Solution Detail</th>
<th>Solution Title</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.Solution__r}">
<tr>
<td>{!cx.SolutionNote}</td>
<td>{!cx.SolutionName}</td>
</tr>
</apex:repeat>
</table>
<p/>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Is what I want to do possible? And if so, can you help me with the error I am receiving.
Thanks!!
The solutions associated with a case have the name 'CaseSolutions', rather than Solutions__r - the __r notation indicates a custom relationship rather than a standard one.
All Answers
The solutions associated with a case have the name 'CaseSolutions', rather than Solutions__r - the __r notation indicates a custom relationship rather than a standard one.
Thanks, but when I change it to "CaseSolutions" I receive the same error.
"Error: Invalid field CaseSolutions__r for SObject Case"
Any ideas?
You don't need the __r on the end. You would only need that if it was a custom relationship that you had created.
Thanks so much. Its working now.
Thank again.
Can you mark it as the solution for those that come after us.
This does not seem to work correctly, I get the following error message:-
Error: Invalid field SolutionNote for SObject CaseSolution
I have used the following code:-
Can you tell me what is wrong.
Thanks
CaseSolution is an object that relates a case to a solution, but SolutionNote is a field on the Solution object. Thus you'd need to follow the relationship to the solution in question: