Skip to main content
2 respostas
  1. 19 de mai. de 2021, 17:47

    Hi Venktesh,

    Please find the solution.

    <apex:page controller="ContactData">

    <apex:form>

    <apex:pageBlock title="Contacts List" id="contacts_list">

    <apex:pageBlockTable value="{! contacts }" var="ct">

    <apex:column value="{! ct.FirstName }"/>

    <apex:column value="{! ct.LastName }"/>

    </apex:pageBlockTable>

    </apex:pageBlock>

    </apex:form>

    </apex:page>

    public ContactData(){

    public List<Contact> getContacts(){

    Account ac=[select id from Account where id=:ApexPages.CurrentPage().GetParameters().Get('acctId') Limit 1];

    List<Contact> contactList=new List<Contact>([Select id,Accountid ,FirstName,LastName from Contact where Accountid=:ac.id]);

    }

    }

    Please mark it as the Best Answer so that other people would take reference from it.

    Thank You