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
JimInSRQJimInSRQ 

How to find specific contact records in apex:repeat based on contact field value.

Hi,

I have a VF email where relatedToType="Account".  I am able to get a list of all contact for the account associated with the email using the following...
 

<table border="1">
        
        <apex:repeat var="cx" value="{!relatedTo.Contacts}">
        
                       
            <tr style='border-bottom: 1px solid #ddd;'>
                <th style="width:150px" align="Right">Name:</th><td valign="center" align="left">{!cx.FirstName} {!cx.LastName}</td>
            </tr>  
            
            
            </apex:repeat>
</table>

What I need to do is return a specfic record instead of the entire list using an IF statement.  
 
if(!relatedTo.Contacts.Dealer_Primary_Contact__c  == true){
}

Unfortunately I am both unable to get the correct syntax as the if statement simply diaplays in the result as text and I still get the entire list.  Any guidance/help is greatly appreciated. 

Thank you!!

JimInSRQJimInSRQ
ANYONE!!??