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
fatmonkfatmonk 

visualforce and Apex on cache 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;

bob_buzzardbob_buzzard

How does the user return to the detail page?  Do they click the browser back button once they've viewed the detail page or is there another route?

 

It sounds like you'll need to put the search criteria onto the URL and execute the search as soon as the page is created.

 

I wrote a blog post around this at:

 

http://bobbuzzard.blogspot.com/2011/06/execute-custom-search-when-opening-page.html

 

its not an exact match for what you are doing but should be close enough to get you started.

 

 

Angela Mullen-Smith 29Angela Mullen-Smith 29
visualforce issue - unrelated details being brought

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

As you can see - the 2 meetings displayed are totally different from the Customer meetings, plus the name is not showing.

The visualforce page is holding an old image and I don't know how to get rid of it
User-added image
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>