Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
I am making a visual force page that can update itself daily to show the loan prospects for the previosu workday. Im thinking I would have to use rerender?

Also, how do I get this code to filter through my result and show only the prospects created yesterday?

 

<apex:page standardController="Prospect__c" recordSetVar="Prospects">

<apex:pageBlock title="Loan Prospects List">

<!-- Contacts List -->

<apex:pageBlockTable value="{! Prospects }" var="Pro">

<apex:Column headerValue="Name">

<apex:outputLink value="/{!Pro.Id}">

<apex:outputText value="{!left(Pro.Name,50)}">

</apex:outputText>

</apex:outputLink>

</apex:Column>

<apex:Column value="{! Pro.Property__c}"/>

<apex:Column value="{! Pro.Contact__c.Phone}"/>

<apex:Column value="{! Pro.Contact__C.MobilePhone}"/>

<apex:Column value="{! Pro.Prospect_Score__c}"/>

<apex:Column value="{! Pro.Email__c}"/>

</apex:pageBlockTable>

</apex:pageBlock>

</apex:page>

 
2 answers
  1. Mar 31, 2016, 6:01 PM
    Hi Bryan,

    Please find the modified code:

    Here I considered:

    (1) Naming convention.

    (2) Used Custom Controller to handle the conditions in the SOQL.

    (3) Tested the solution in my DE environment and looks good.

    <apex:page controller="ProspectExtController">

    <apex:pageBlock title="Loan Prospects List">

    <!-- Contacts List -->

    <apex:pageBlockTable value="{!prosList}" var="Pro">

    <apex:Column headerValue="Name">

    <apex:outputLink value="/{!Pro.Id}">

    <apex:outputText value="{!left(Pro.Name,50)}">

    </apex:outputText>

    </apex:outputLink>

    </apex:Column>

    <apex:Column value="{! Pro.Property__c}"/>

    <apex:Column value="{! Pro.Contact__r.Phone}"/>

    <apex:Column value="{! Pro.Contact__r.MobilePhone}"/>

    <apex:Column value="{! Pro.Prospect_Score__c}"/>

    <apex:Column value="{! Pro.Email__c}"/>

    </apex:pageBlockTable>

    </apex:pageBlock>

    </apex:page>

    Controller:

     

    public class ProspectExtController {

    public List<Prospect__c> prosList {get; set;}

    public ProspectExtController() {

    prosList = [Select Id, Name, Property__c, Contact__c, Contact__r.Phone, Contact__r.MobilePhone,

    Prospect_Score__c, Email__c from Prospect__c where CreatedDate = Yesterday];

    }

    }

    Please do let me know if it helps you.

    Regards,

    Mahesh
  2. Mar 31, 2016, 6:35 PM
    Hi Mahesh.

    Thank you for your help, I had gotten around to doing it this way as well and this response verified my efforts. I am now trying to place the results from my visualforce page on to an email, is it possible that I can call my results directly from a visualforce template?
0/9000