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
skr00skr00 

Unable to retrieve data

<apex:page standardController="Position__c" id="thePage">
<apex:form >
<apex:pageBlock >
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="!save" value="Save"/>
<apex:commandButton action="!cancel" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Position__c.Department__c}">
</apex:inputField>
<apex:inputField value="{!Position__c.Job_Description__c}">
</apex:inputField>
</apex:pageBlockSection>
</apex:pageBlock>

<apex:pageBlock >
<apex:pageBlockTable value="{!Position__c.R00N30000002btlAEAQ__r}" var="JA" title="Job Applications">
<apex:column value="{!JA.Candidate__c}"/>
<apex:column value="{!JA.Candidate_Qualified__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>

</apex:form>
</apex:page>

 

I'm not receiving any error while saving but unable to get the desired output ....any thought on this

 

Nilesh ManeNilesh Mane

Can you share ur controller code?

skr00skr00

i have posted it on the top.

 

Thanks

Nilesh ManeNilesh Mane

PLz share ur controller code... so that i can fix it quickly...

skr00skr00

<apex:page standardController="Position__c" id="thePage">
<apex:form>
<apex:pageBlock>
<apex:pageMessages></apex:pageMessages>
<apex:pageBlockButtons location="bottom">
<apex:commandButton
action="{!save}" value="Save">
</apex:commandButton>
<apex:commandButton
action="{!cancel}" value="Cancel">
</apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="1">
<apex:inputField
value="{!Position__c.Department__c}">
</apex:inputField>
<apex:inputField
value="{!Position__c.Job_Description__c}">
</apex:inputField>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock>
<apex:pageblockTable
value="{!Position__c.Job_Application__r}" var="JA">
<apex:column value="{!JA.Candidate__r.First_Name__c}">
</apex:column>
<apex:column value="{!JA.Candidate__r.Last_Name__c}">
</apex:column>
<apex:column value="{!JA.Candidate_Qualified__c}">
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

I have replaced Job_Application__r with actual value "R00N30000002btlAEAQ__r"
& Candidate__r with "R00N30000002btlBEAQ". As API names for relations shows errors.

 

 

 

Nilesh ManeNilesh Mane

Is this ur desired output?

skr00skr00

Yep with - First Name Last Name & Candidate Qualified? My output shows only

 

Nilesh ManeNilesh Mane

Try below code:

 

<apex:pageblockTable
value="{!Position__c.Job_Application__c}" var="JA">
<apex:column value="{!JA.Candidate__r.First_Name__c}">
</apex:column>
<apex:column value="{!JA.Candidate__r.Last_Name__c}">
</apex:column>
<apex:column value="{!JA.Candidate_Qualified__c}">
</apex:column>
</apex:pageblockTable>

Nilesh ManeNilesh Mane

what error r u getting?

Pri..Pri..

Error: Invalid field Job_Application__r for SObject Position__c