You need to sign in to do that
Don't have an account?
Jim Montgomery
Error: Invalid field ActivityDate for SObject Account
I am trying to write a custom VF page to display account history only for the logged in user.
I am using account as the standard controller, and have an extension controller to do the filtering.
I am getting the above error when attempting to save my VF page.
Class:
public class AccExtensions{
Public List<Account> AHS{get;set;}
public AccExtensions(ApexPages.StandardController controller) {
AHS=[select id, name,(select ActivityDate, ActivityType from ActivityHistories where OwnerId = :UserInfo.getUserId())from account where ID=:ApexPages.currentPage().getParameters().get('id')];
for(Account ah:AHS) {
AHS.add(ah);
}
}
}
VF Page
<apex:page standardController="Account" extensions="AccExtensions" >
<apex:pageBlock>
<apex:pageblockTable value="{!AHS}" var="acch">
<apex:Column headervalue = "Date" value="{!acch.ActivityDate}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:page>
I am using account as the standard controller, and have an extension controller to do the filtering.
I am getting the above error when attempting to save my VF page.
Class:
public class AccExtensions{
Public List<Account> AHS{get;set;}
public AccExtensions(ApexPages.StandardController controller) {
AHS=[select id, name,(select ActivityDate, ActivityType from ActivityHistories where OwnerId = :UserInfo.getUserId())from account where ID=:ApexPages.currentPage().getParameters().get('id')];
for(Account ah:AHS) {
AHS.add(ah);
}
}
}
VF Page
<apex:page standardController="Account" extensions="AccExtensions" >
<apex:pageBlock>
<apex:pageblockTable value="{!AHS}" var="acch">
<apex:Column headervalue = "Date" value="{!acch.ActivityDate}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:page>
Jim Montgomery Manager, Sales Intelligence Operations Wolters Kluwer Tax & Accounting 20101 Hamilton Ave. Torrance, CA 90502 877-346-7148 jim.montgomery@wolterskluwer.com
All Answers
Apex Controller:
Visualforce Page:
Hope that helps!
Jim Montgomery Manager, Sales Intelligence Operations Wolters Kluwer Tax & Accounting 20101 Hamilton Ave. Torrance, CA 90502 877-346-7148 jim.montgomery@wolterskluwer.com