You need to sign in to do that
Don't have an account?
jaw99KCG
Visualforce Email Template Related Info
I have a template for a Custom Object Business_Trip__c with Child relationship to Event via Custom Lookup.
I want to show related meetings.
Template below:
<p><b>Planned Meetings:</b></p>
<table border="1" >
<apex:repeat var="cx" value="{!relatedTo.Meetings__r}">
<tr>
<td>Name: {!cx.WhoId}</td>
<td>Date: {!cx.ActivityDate}</td>
<td>Company: {!cx.Whatid}</td>
<td>Subject: {!cx.Subject}</td>
<td>Notes: {!cx.Comments_Summary__c}</td>
</tr>
</apex:repeat>
</table>
<p />
Provides indecipherable results:
Planned Meetings:
**Name: 003J000001EWnkiIAD** Date: Thu Jul 09 00:00:00 GMT 2015 **Company: 001J000001btDA7IAM** Subject: Quarter review
When what I want is:
**Name: Joe Conact** Date: Thu Jul 09 00:00:00 GMT 2015 **Company: AcmeWidgetCo**. Subject: Quarter review
How do I get the names - the Contact and Account names - from the relation? thanks!
I have tried:
<td>Name: {!cx.Who}</td> - Causes big error on test send
<td>Name: {!cx.WhoId.name}</td> - gets Error: Unknown property 'String.name'
<td>Name: {!cx.WhoId__r.name}</td>
and
<td>Name: {!cx.Who__r.name}</td>
Both get - Error: Invalid field WhoId__r for SObject LookedUpFromActivity
I want to show related meetings.
Template below:
<p><b>Planned Meetings:</b></p>
<table border="1" >
<apex:repeat var="cx" value="{!relatedTo.Meetings__r}">
<tr>
<td>Name: {!cx.WhoId}</td>
<td>Date: {!cx.ActivityDate}</td>
<td>Company: {!cx.Whatid}</td>
<td>Subject: {!cx.Subject}</td>
<td>Notes: {!cx.Comments_Summary__c}</td>
</tr>
</apex:repeat>
</table>
<p />
Provides indecipherable results:
Planned Meetings:
**Name: 003J000001EWnkiIAD** Date: Thu Jul 09 00:00:00 GMT 2015 **Company: 001J000001btDA7IAM** Subject: Quarter review
When what I want is:
**Name: Joe Conact** Date: Thu Jul 09 00:00:00 GMT 2015 **Company: AcmeWidgetCo**. Subject: Quarter review
How do I get the names - the Contact and Account names - from the relation? thanks!
I have tried:
<td>Name: {!cx.Who}</td> - Causes big error on test send
<td>Name: {!cx.WhoId.name}</td> - gets Error: Unknown property 'String.name'
<td>Name: {!cx.WhoId__r.name}</td>
and
<td>Name: {!cx.Who__r.name}</td>
Both get - Error: Invalid field WhoId__r for SObject LookedUpFromActivity
If we see the simple quesry on task it will be like so in your case you can also try with {!cx.who.Name}
please let me know if this will help,
Thanks,
Keyur Modi
All Answers
If we see the simple quesry on task it will be like so in your case you can also try with {!cx.who.Name}
please let me know if this will help,
Thanks,
Keyur Modi