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 

Visualforce Email with APEX lookup, need to find record with specific value

Visualforce Email with APEX lookup, need to find record with specific value. Related to type = Accounts.

I'm trying to find specific contacts using APEX code, but I need the results to list only contact records on which a specific field (Checkbox) = True.  As I'm still new to VF and Apex I'm not sure how to define the if value and I've had no luck searching.

The field is called "Dealer_Authorizer__c", I want only those records where Dealer_Authorizer__c=true.  How do I define that in the following code which returns all contact records...

 

<table border="1">
        
        <apex:repeat var="cx" value="{!relatedTo.Contacts}">
        
        <tr>
            <td>Name:</td><td valign="center" align="left">{!cx.FirstName} {!cx.LastName}</td>
        </tr>

        </apex:repeat>
</table>
JimInSRQJimInSRQ
ANYONE??!!