function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Visualforce Email Template Help

I'm trying to send an automated email alert to a SF user using a VF email template.  I fear I may be trying to traverse too many objects to get the right data.  I'm trying to send related data from the Topic Content object to the User related to the Participant object.  This image will clear things up:




For the recipient and relatedToType:



recipientType="User" relatedToType="Participant__c">

And to try and grab the Topic Content:



<apex:repeat var="tc" value="{!relatedTo.Class__c.Topic__c.Topic_Content__r}">

 I get this error message:


Error: Unknown property 'String.Topic__c'



I appreciate any help with this.. thanks in advance.

Imran MohammedImran Mohammed

Try the below code

<apex:repeat var="tc" value="{!relatedTo.Class__r.Topic__r.Topic_Content__c}">


Let me know if it doesn't work.


Thanks for your help Imran.  You got me one step closer I think.


The error message is now related to the '.Topic_Content__c' part of the code.


"Error: Invalid field Topic_Content__c for SObject Topic__c"


Any ideas?

Imran MohammedImran Mohammed

Check what is the field name created for Topic Content in Topic object.

Then use that field as <<Custom_Field>>__c.

Even if that does not work,

Then use __r for that custom field.