Skip to main content
1 of 3
Viraj
  • 568
  • 2
  • 5
  • 20

Fetch custom object record details using case

I'm trying to fetch the record details and display on the VF page with below code.

I have case lookup with a custom object (say, Evaluation__c) and my requirement is - open a case on a VF page and display details of Evaluation__c object record.

Am I missing something? Pls guide.

Image illustration below: enter image description here

Code below:

<apex:page standardController="Evaluation__c">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Evaluation Details" columns="2">

                <apex:pageBlockSectionItem>
                    <apex:outputLabel value="Case Number" />
                    <apex:inputField value="{!Evaluation__c.Case__c} " id="Case__c" label="Case Number" required="false" />
                </apex:pageBlockSectionItem>


            </apex:pageBlockSection>
            <apex:pageBlockButtons>
                <apex:commandButton value="Submit" action="{!save}" />
            </apex:pageBlockButtons>
        </apex:pageBlock>

        <apex:pageBlock>

            <apex:pageBlockSection>
                <apex:pageBlockTable value="{! Evaluation__c }" var="e">
                    <apex:column value="{! e.Case__c }" />
                    <apex:column value="{! e.Evaluation__c.EvaluationNumber__c }" />
                    <apex:column value="{! e.Evaluation__c.Max_Points__c }" />
                    <apex:column value="{! e.Evaluation__c.Score__c }" />
                </apex:pageBlockTable>
            </apex:pageBlockSection>

        </apex:pageBlock>

    </apex:form>
</apex:page>
Viraj
  • 568
  • 2
  • 5
  • 20