+ Start a Discussion
Robin BarnwellRobin Barnwell 

Filtering the StandardSetController in VisualForce

Is it possible to an a filter in this VF code to limit the Contact to just those where coontact customer field AtRisk__C = True.  Don't want to do any more code.

<apex:page standardController="Contact" recordSetVar="cont">
    <apex:pageBlock title="At-risk Contacts">
        <apex:pageBlockTable value="{!cont}" var="c">
            <apex:column value="{!c.name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>
NagendraNagendra (Salesforce Developers) 
Hi Robin,

Sorry for this issue you are encountering.

May I suggest you please check with below link from the forums community with a similar discussion which might help. Please let us know if this helps.

Regards,
Nagendra
Vinod ChoudharyVinod Choudhary
Hi Robin,

I think you can check condition in   "rendered="{!IF(AtRisk__C), true, false)}".

If i get it correct do you need something like:
 
<apex:outputPanel rendered="{!IF(AtRisk__C), true, false)}">
<apex:page standardController="Contact" recordSetVar="cont">
    <apex:pageBlock title="At-risk Contacts">
        <apex:pageBlockTable value="{!cont}" var="c">
            <apex:column value="{!c.name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>
</apex:outputPanel>



 
Robin BarnwellRobin Barnwell
Thanks Nagendra, I'd already reviewed that post.  That uses Apex which I'm trying to see if I can avoid.  Plus is referencing a related list not the core object.

Just looking to put a filter on the standard object in a VF screen