Trying to create a list of Open activities so that I can sort and display as an apexDataTable on a VF page.
I'm currently seeing the error:
Invalid field Subject for SObject Account
VF Page Snippet:
<apex:dataTable value="{!actList}" var="TheOpenActivities" rowClasses="odd,even" styleClass="table5" rows="10">
<apex:facet name="header">Action Plan</apex:facet>
<apex:facet name="footer">
See full list of open activities >
</apex:facet>
<apex:column >
<apex:facet name="header">Action Plan</apex:facet>
<apex:outputLink value="/{!TheOpenActivities.ID}">
<apex:outputText value="{!TheOpenActivities.Subject}">
</apex:outputText>
</apex:outputLink>
</apex:column>
<apex:column >
<apex:facet name="header">Due Date</apex:facet>
<apex:outputText value="{0, date, dd/MM/yyyy}">
<apex:param value="{!TheOpenActivities.ActivityDate}" />
</apex:outputText>
</apex:column>
<apex:column >
<apex:facet name="header">Responsible</apex:facet>
<apex:outputText value="{!TheOpenActivities.Owner.Name}" />
</apex:column>
</apex:dataTable>
SOQL query below:
public list<Account> getActList() {
Current_Acc_Id = ApexPages.currentPage().getParameters().get('id');
List<Account> ActList = [
SELECT (SELECT ID, Subject, ActivityDate, Status, Priority, OwnerId FROM OpenActivities WHERE Status =:'Open') FROM Account
WHERE account.id = :Current_Acc_Id
];
return ActList;
}
I'm hoping the problem is quite a simple fix (I'm currently teaching myself to use apex as I go). Can someone point out my error with an explanation so I understand what has gone wrong?
Ive reviewed the question here: System.sObjectException: Invalid Field – trying to use a nested SOQL query but don't understand how to apply the solution to my problem (if it is actually relevant).
apex:repeat
to loop over the child object.