0

I have two custom objects those are position and job application objects,those are related by lookup relationship.But when try to access the job applications through relationship I m getting above Error. please help me out.

here is my visualforce Page

       <apex:pageBlockTable value="{!Position__c.Job_Application__r}" var="JA"></apex:pageBlockTable>

       <apex:pageBlockButtons location="bottom">
           <apex:commandButton value="save" action="{!save}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
       </apex:pageBlockButtons>
   </apex:pageBlock>

2
  • You probably want Job_Applications__r. The name of the relation is set as one of the properties of the lookup field on the child object. Oct 18, 2014 at 16:06
  • @Lex, you should add this as an answer as I believe you are correct. Perhaps show the OP where they can go to find the Child Relationship Name as well. Oct 18, 2014 at 16:50

2 Answers 2

2

You'll have to use the child relationship name, probably Job_Applications__r in this case.

You can find the child relationship name as a part of the properties of the lookup field on the child object. Click on the name of the lookup field, the child relationship name appears at the bottom right of the screen.

0

Error: Invalid field Job_Applications__r for SObject Position__c

 function loadApplicants() {
        <apex:repeat value="{!Position__c.Job_Applications__r}" var="jobApp">
            applicants.push({ 
                name: "{!JSENCODE(jobApp.Candidate__r.First_Name__c + ' ' + 
                                 jobApp.Candidate__r.Last_Name__c)}",
                address: "{!JSENCODE(jobApp.Candidate__r.Street__c  + ', ' + 
                                    jobApp.Candidate__r.City__c + ', ' + 
                                    jobApp.Candidate__r.State_Province__c)}",
                viewLink: "{!JSENCODE(LINKTO(jobApp.Candidate__r.First_Name__c + 
                                       ' ' + jobApp.Candidate__r.Last_Name__c, 
                                    $Action.Candidate__c.View, 
                                    jobApp.Candidate__c))}"
            });
        </apex:repeat>
    }
1
  • If you have a question you can start a new question bu clicking "Ask question" link on the top right. You shouldn't put your questions as answers for other questions. Mar 18, 2016 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .