You need to sign in to do that
Don't have an account?
Qury to fetch the records in master detail relation
Hi all,
I have one master- Child relation between two objects Case_Accession (Master) , Apcase(Child). Now I want to access the different fileds in one object only of Case_Accession so that I can show it on VF page in the form of Data Table. But I am getting error "Error: Could not resolve field 'CaseNo__c' from <apex:outputField> value binding '{!wrklst.CaseNo__c}' in page WorkList".
My Code is this
public class Worklist
{
public List<Case_Accession__c> objWorklist {get;set;}
public Worklist()
{
objWorkList = new List<Case_Accession__c>();
objWorkList = [Select PatientName__c,PhysicianName__c ,(select CaseNo__c from ApCase__r) from Case_Accession__c];
}
Visual Foce
<apex:page controller="Worklist">
<apex:Form >
<apex:pageBlock >
<apex:pageblockSection >
<apex:dataTable id="dtWorklist" value="{!objWorklist }" var="wrklst" cellspacing="16%">
<apex:column headerValue="Patient Name" >
<apex:outputField value="{!wrklst.PatientName__c}" />
</apex:column>
<apex:column headerValue="Physician Name" >
<apex:outputField value="{!wrklst.PhysicianName__c}" />
</apex:column>
<apex:column headerValue="Physician Name" >
<apex:outputField value="{!wrklst.CaseNo__c}" />
</apex:column>
<apex:column headerValue="Edit Case">
<apex:commandLink title="Edit" value="Edit"/>
</apex:column>
</apex:dataTable>
</apex:pageblockSection>
</apex:pageBlock>
</apex:Form>
</apex:page>
Please help, Thanks in advance
}
Modify like this
<apex:dataTable id="dtWorklist" value="{!objWorklist }" var="wrklst" cellspacing="16%">
<apex:column headerValue="Patient Name" >
<apex:outputField value="{!wrklst.PatientName__c}" />
</apex:column>
<apex:column headerValue="Physician Name" >
<apex:outputField value="{!wrklst.PhysicianName__c}" />
</apex:column>
<apex:column headerValue="Physician Name" >
<apex:dataTable id="apcase" value="{!wrklst.ApCase__r}" var="apcase" cellspacing="16%">
<apex:column headerValue="">
<apex:outputField value="{!apcase.CaseNo__c}" />
</apex:column>
</apex:dataTable>
</apex:column>
<apex:column headerValue="Edit Case">
<apex:commandLink title="Edit" value="Edit"/>
</apex:column>
</apex:dataTable>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks