[SalesForce] Getting an Error: Unknown property ‘core.email.template.EmailTemplateComponentController.Case’ on VF Email template

I am firstly creating a VF Email Template, a table below, then after WILL create a batch class to include NOT completed Tasks and case numbers in the email with specific criteria and I am getting the error.

I have commented the formula and the lookup field to isolate the issue on my VF email template however I am still getting this error Error: Unknown property 'core.email.template.EmailTemplateComponentController.Case'

I have checked for similar issue but none found. I already checked that there is no controller for Email Template yet that has been created.

      <messaging:emailTemplate subject="ABCA Task Due in 1 Week" recipientType="User" relatedToType="Case">
      <messaging:htmlEmailBody>



      <html>

     <p style='margin-top:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm;line- 
     height:107%;font-size:15px;font-family:"Calibri",sans-serif;'><span style='font-size:14px;line- 
     height:107%;font-family:"Segoe UI",sans-serif;color:#172B4D;background:white;'>The below ABCA 
     Tasks are due in 1 week:</span></p>
     <p style='margin-top:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm;line- 
     height:107%;font-size:15px;font-family:"Calibri",sans-serif;'><br></br></p>

     <table border="1">

       <tr>
           <td> SF Case Ref  </td>
           <td> Case Subject </td>
           <td> Case Manager </td>
           <td>  Client Name </td>
           <td> Sub Product </td>
           <td> Task Subject </td>
           <td> Due Date </td>
           <td> Pega Ref </td>

      </tr>

      <tr>
         <td> {!Case.CaseNumber}          </td>
         <td> {!Case.Subject}             </td>
         <td> <!--{!Case.Case_Owner_Name__c }  -->             </td>
         <td> <!--{!relatedTo.ContactId.name__r}  -->         </td> 
         <td> {!Case.Sub_Product}        </td>
         <td> {!Task.Subject}            </td>
         <td> {!Task.ActivityDate}       </td>
         <td> {!Case.Complaints_Pega_Case_Ref__c} </td>


     </tr>

   </table>

 <p><br></br></p>
 <p><br></br></p>
 <p style='margin-top:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm;line-height:107%;font- 
     size:15px;font-family:"Calibri",sans-serif;'><span style='font-size:14px;line-height:107%;font- 
     family:"Segoe UI",sans-serif;color:#172B4D;background:white;'>Note: this is an automated 
     email</span></p>

 </html>

   <messaging:plainTextEmailBody>
 </messaging:plainTextEmailBody>

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

Best Answer

I believe you are supposed to use relatedTo instead of case

<td> {!RelatedTo.Complaints_Pega_Case_Ref__c} </td>
Related Topic