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
bhanu reddy 24bhanu reddy 24 

plzz modify the error

User-added image
Best Answer chosen by bhanu reddy 24
Pradeep SinghPradeep Singh
<apex:page controller="accContrl">
    <apex:pageBlock>
        <apex:pageBlockTable value="{!accList}" var="acc">
            <apex:column value="{!acc.id}"/>
            <apex:column value="{!acc.name}"/>
            <apex:column headerValue="Contact">
                <apex:pageBlockTable value="{!acc.Contacts}" var="con">
                    <apex:column value="{!con.name}"/>
                </apex:pageBlockTable>
            </apex:column>
            <apex:column headerValue="Opportunity">
                <apex:pageBlockTable value="{!acc.Opportunities}" var="opp">
                    <apex:column value="{!opp.name}"/>
                </apex:pageBlockTable>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>


public class accContrl{
    
    public List<Account> accList {get;set;}
    public accContrl(){
        accList =[Select id,name,(select id,name from contacts),(select id,name from opportunities) from account];
    }
}

If this solves your issue, please mark it as solved. 

All Answers

Pradeep SinghPradeep Singh
<apex:page controller="accContrl">
    <apex:pageBlock>
        <apex:pageBlockTable value="{!accList}" var="acc">
            <apex:column value="{!acc.id}"/>
            <apex:column value="{!acc.name}"/>
            <apex:column headerValue="Contact">
                <apex:pageBlockTable value="{!acc.Contacts}" var="con">
                    <apex:column value="{!con.name}"/>
                </apex:pageBlockTable>
            </apex:column>
            <apex:column headerValue="Opportunity">
                <apex:pageBlockTable value="{!acc.Opportunities}" var="opp">
                    <apex:column value="{!opp.name}"/>
                </apex:pageBlockTable>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>


public class accContrl{
    
    public List<Account> accList {get;set;}
    public accContrl(){
        accList =[Select id,name,(select id,name from contacts),(select id,name from opportunities) from account];
    }
}

If this solves your issue, please mark it as solved. 
This was selected as the best answer
bhanu reddy 24bhanu reddy 24
thank you so much responding me