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

SObject row was retrieved via SOQL without querying the requested field: Task.Status Error

Hi guys, I created a visualforce email template but I'm Stack with the error that says "Object row was retrieved via SOQL without querying the requested field: Task.Status"


I'm stack with this one I need your help please.


Below are the Complete codes:


<messaging:emailTemplate recipientType="Contact"
subject="Meeting Minutes: {!}-{!relatedTo.Call_Date__c}"
<messaging:htmlEmailBody >
<style type="text/css">

border-width: 2px;
border-style: dashed;
border-size: 2px;
border-color: blue;
background-color: #CCCCCC;

border-width: 5px;
border-spacing: 5px;
border-style: dashed;
border-color: #FF0000;
background-color: #FFFFFF;
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #000000;
background-color: #FFEECC;
color: #000000;
border-width: 1px ;
padding: 4px ;
border-style: solid ;
border-color: #000000;
background-color: #FFFFF0;


<apex:image id="Logo" value="" height="64" width="90"/>
<table border="2">
<p>Meeting Minutes with {!},</p>
<p>Meeting Date &nbsp; &nbsp;<apex:outputText value="{0,date,M/d/yyyy }"> <apex:param value="{!relatedTo.Call_Date__c}" /> </apex:outputText> .</p>
<p>Location: {!relatedTo.Location__c}.</p>
<p>BlueScope Steel representative: {!relatedTo.Owner.Name}.</p>

<p>Meeting Summary:


<center><b>Open Activities</b></center>
<table border="2">
<apex:repeat value="{!relatedTo.Tasks}" var="cx">
<td style="text-align:right; display:{!if (cx.Status=='Completed' && cx.Visible_to_Customer__c==true,'none','table-column')}">{!}</td>
<td style="text-align:right; display:{!if (cx.Status=='Completed' && cx.Visible_to_Customer__c==true,'none','table-column')}">{!cx.Subject}</td>
<td style="text-align:right; display:{!if (cx.Status=='Completed' && cx.Visible_to_Customer__c==true,'none','table-column')}"><apex:outputText value="{0,date,M/d/yyyy }"> <apex:param value="{!cx.ActivityDate}" /> </apex:outputText></td>
<td style="text-align:right; display:{!if (cx.Status=='Completed' && cx.Visible_to_Customer__c==true,'none','table-column')}">&nbsp;&nbsp;{!cx.Status}</td>

Should you have any questions, please feel free to contact me.
<apex:outputLink value="">
For more detailed information login to




The error is because the staus field from Task object is not included in the query. Include the status field in the query for Task and it will resolve your issue.