+ Start a Discussion

Rendering only if a field from one Object equals a field from another Object

I have two objects: Positions and Candidates. Each has a field named Job Title. I want to create a VF page that shows all instances Job Title matches in both Objects (I'm trying to match all Candidates in the system with new open jobs that we have open).


I got excited when I saw this code & used it on one of my Visualforce pages because it does something close to what we need, but not exactly:


<apex:page standardController="Position__c" recordSetVar="positions" sidebar="false" showHeader="false">
    <apex:pageBlock >
        <h1>Welcome to the Sloan Professional Services Careers Home Page!</h1>
        <p>Sloan Professional Services is an industry leader, and to stay ahead of the pack, we need to grow! We are currently seeking bright and talented professionals to join our winning team.  Browse the current openings below, and send in your resume via email to apply today.</p>
        <br />
        <apex:pageBlockTable value="{!positions}" var="position">
            <apex:column value="{!position.name}" rendered="{!IF(position.Status__c == 'Open - Approved', true, false)}"/>
            <apex:column value="{!position.Location__c}" rendered="{!IF(position.Status__c == 'Open - Approved', true, false)}"/>
            <apex:column value="{!position.Posted_Job_Description__c}" rendered="{!IF(position.Status__c == 'Open - Approved', true, false)}"/>

I tried changing what was being redered by making the IF statements apply to the Candidate field "Job Title" = Position "Job Title" but was completely unsuccessful. Anyone know how I can do this?


Hi Brett,


      I would say if you have a junction say "Job" object between Positions and Candidates, it would be easier to search the records in "Job" Object having a specific title. In this way you can get both position details and candidate details.


Thanks Sarge! How do I create an automatic listing (within the new "Job" Object) that will show when all Candidates Object field Position Title matches a given Position Object Position Title field? I'm basically doing the same thing as the Create View does but I don't want to have to enter the active Position.Position_Title every time in the filter criteria.