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
geetha b 8geetha b 8 

Here i am not getting Account Id

<apex:page standardController="Account" extensions="contrller">
  <apex:form >
    <apex:pageblock >
       <!-- Display Account related Contacts -->
       <apex:pageBlockTable value="{!relatedContacts}" var="val">
         <apex:column value="{!}"/>
         <apex:column value="{!}"/>


public with sharing class contrller {
Public id Current_Acc_Id;

    public contrller(ApexPages.StandardController controller) {
    Current_Acc_Id = controller.getRecord().id;
    system.debug('--------------------Current_Acc_Id------------------------'+Current_Acc_Id );

    public List<Contact> getrelatedContacts(){
        List <contact> conList = New List<Contact>();
        system.debug('--------------------Current_Acc_Id------------------------'+Current_Acc_Id );
        for(Account acc:[select id,name,(select name,id,email from contacts) from account where id=:Current_Acc_Id])
           for(contact con:acc.contacts)
        return conList;
no records are displayed
PratikPratik (Salesforce Developers) 
Hi Geetha,

You can refer to below link:

Sample code:

Public Class getrid {

    public string rid{get;set;}
    Public getrid ( Apexpages.standardcontroller controller) {


P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
Hii  Geetha,
                 please pass  the account id  in  your URL  then it will return you the id of the current record in context.