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
DannyTKDannyTK 

Visualforce template does not have a controller that can be selected for preview

Good morning,

I created a Visualforce email template using "User" object as my recipienttype and "Lead" object as my relatedToType, but when trying to test the window doesn't display the test record field to select but rather states "Visualforce template does not have a controller that can be selected for preview" and gives only the option to send myself a test email without being able to attach a record to use for the test (what's being tested is how the record details is displayed).

Email Template is as follows: 

<messaging:emailTemplate subject="New lead assigned to you: {!relatedto.Name} for Partner Company: <b>{!relatedto.Partner_Company__c}</b>" recipientType="User" relatedToType="Lead">
<messaging:htmlEmailBody >

*** NEW LEAD ASSIGNMENT NOTIFICATION *** <p/>
<br></br>
The following lead has been assigned to you:<p/>
Company:  {!relatedto.Company} <p/>
Lead Name:  {!relatedto.Name} <p/>
<br></br>
<apex:outputLink value="https://na15.salesforce.com/{!relatedto.id}">Click here to view record</apex:outputLink><p/>
<br></br>

</messaging:htmlEmailBody>
</messaging:emailTemplate>

________________________
Seems pretty basic, and i've deployed several other emails before, but this is the first occurance of this message on testing. Does anyone know what may be the culprit?

-d
sandeep@Salesforcesandeep@Salesforce
HI, 
Yes, They do not have controler directly but if we use component ( along with Controller) then we can perform flexible solutions over VF template.

Thanks 
Sandeep Singhal
http://www.codespokes.com/