You need to sign in to do that
Don't have an account?
Thorsten Heinrich
Getting Error:Could not resolve field 'OpenActivities' from <apex:outputField> value binding '{!a.OpenActivities}' in page leaddetail
Please help me getting open Activity list on visuaforce page..Here is my code.
// Page
<apex:pageBlock title="Open Activity" >
<apex:pageBlockTable value="{!ActivityList}" var="a">
<apex:column value="{!a.OpenActivities }"/>
</apex:pageBlockTable> </apex:pageBlock>
//Controller method
public List<Lead_Inspector__c>getActivityList(){ List<Lead_Inspector__c> lst =[SELECT (SELECT ActivityDate, Description FROM OpenActivities ORDER BY ActivityDate ASC NULLS LAST, LastModifiedDate DESC LIMIT 500)FROM Lead_Inspector__c WHERE id = :leadId ];
return lst; }
// Page
<apex:pageBlock title="Open Activity" >
<apex:pageBlockTable value="{!ActivityList}" var="a">
<apex:column value="{!a.OpenActivities }"/>
</apex:pageBlockTable> </apex:pageBlock>
//Controller method
public List<Lead_Inspector__c>getActivityList(){ List<Lead_Inspector__c> lst =[SELECT (SELECT ActivityDate, Description FROM OpenActivities ORDER BY ActivityDate ASC NULLS LAST, LastModifiedDate DESC LIMIT 500)FROM Lead_Inspector__c WHERE id = :leadId ];
return lst; }
Relation is fine. but issue is you are refering {!a.OpenActivities } for <apex:column which does not support
{!a.OpenActivities } is basically as per you query returns list of OpenActivities but <apex:column expects a field
you can do some thing like below
<apex:pageBlock title="Open Activity" >
<apex:pageBlockTable value="{!ActivityList}" var="a">
<apex:repeat value="{!a.OpenActivities }" var="b">
<apex:column value="{!b.ActivityDate}"/>
<apex:column value="{!b.Description }"/>
</aepx:repeat>
</apex:pageBlockTable> </apex:pageBlock>
this snippet for your reference as I dont know what exaclty you wnat to keep inside the table.
let me know, if it helps you or need any help :)
shiva.sfdc.backup@gmail.com
All Answers
please specify the change where to do this exactly in the code..
Relation is fine. but issue is you are refering {!a.OpenActivities } for <apex:column which does not support
{!a.OpenActivities } is basically as per you query returns list of OpenActivities but <apex:column expects a field
you can do some thing like below
<apex:pageBlock title="Open Activity" >
<apex:pageBlockTable value="{!ActivityList}" var="a">
<apex:repeat value="{!a.OpenActivities }" var="b">
<apex:column value="{!b.ActivityDate}"/>
<apex:column value="{!b.Description }"/>
</aepx:repeat>
</apex:pageBlockTable> </apex:pageBlock>
this snippet for your reference as I dont know what exaclty you wnat to keep inside the table.
let me know, if it helps you or need any help :)
shiva.sfdc.backup@gmail.com