• Angela Mullen-Smith 29
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am trying to show related meetings in an Inline Visualforce Page. 
It was working but seems to have gone weird 

Basically, I am looking to display on a Custom object the last 2 meetings on a Customer Account

ie Customer has 2 meetings

User-added image


This was then be available as an Inline VFP
User-added image
As you can see - the 2 meetings displayed are totally different from the Customer meetings, plus the name is shown. In fact tey have become Static - in that every record shows the same 2 meetings

Just not sure what I have done wrong

Apex
Public without sharing class EventController {


public List <Event> EventList{get;set;}
Public EventController(ApexPages.StandardController stdController){
FMR__c FMR = (fmr__c)stdController.getRecord();

this.Eventlist= [SELECT Id, Type, Subject, StartDateTime, WhatID,whoid,
    (SELECT Relation.Name FROM EventRelations where Relation.Type='Contact' and IsParent = True)
   FROM Event 
   WHERE ((IsDeleted = False) and (Type= 'Meeting')  and (CreatedDate = LAST_N_DAYS:365) and (ActivityDate = LAST_N_DAYS:365) and 
   WhatID =:FMR.Accountid__c)
        OR
        ((IsDeleted = False)  and (Type= 'Meeting')  and (ActivityDate >= TODAY))
         
        order by StartDateTime desc limit 2 ];
        }
}

Visualforce Page

<apex:page StandardController="FMR__c"  extensions="EventController">
    <apex:pageBlock title="Related Meetings List">
        
        <!-- Meeting List -->
        <apex:pageBlockTable value="{!Eventlist}" var="Event">
            <apex:column value="{! Event.Type }"/>
            <apex:column value="{! Event.Subject }"/>
            <apex:column value="{! Event.StartDateTime }"/>
            <apex:column value="{! Event.whoId}"/> 
            <apex:outputText value="{!FMR__c.AccountID__c}" rendered="false"/>
            <apex:pageblocktable value="{!Event.EventRelations}" var="er">
            <apex:column value="{! er.Relation.Name }"/>
            <apex:outputfield value="{!er.Relation.Name}"/>
            </apex:pageBlockTable>
        </apex:pageBlockTable>
        
    </apex:pageBlock>
</apex:page>

I am a newbie to VF and Apex. I have developed a custom account search which return a listview.

ListView account links to Detail page. Here is a problem: when user returns from detail page, the listview is fresh or clear out. How could i keep the listview of search result. I turn cache="true" it does not work?

Thanks;

  • September 30, 2011
  • Like
  • 0