Why is the apex pageblocktable not showing records?

282    Asked by ElveraPeasley in Salesforce , Asked on Mar 3, 2023

 I'm querying Task records from the constructor and displaying them in Pageblocktable but it's not displaying records in the Pageblock table. Could you please let me know what went wrong?


{!tasklist}

    
         
            
        
    

public class myControllerExtension {
public Account acct {get;set;}
public List tasklist  {get;set;}
public myControllerExtension(ApexPages.StandardController stdController) {
    acct = (Account)stdController.getRecord();
    tasklist = [Select Id, Subject from Task limit 20];     
}
}
Answered by Dipika Agarwal

Problem in below line of your code which is why apex pageblocktable not showing records:


 

Please check below code:




       

           

       

   


Apex controller:

public class myControllerExtensionss {
public List tasklist {get;set;}
public Account acct {get;set;}
public myControllerExtensionss(ApexPages.StandardController stdController) {
    tasklist=new List();
    acct = (Account)stdController.getRecord();
    tasklist = [Select Id, Subject from Task limit 20];
}}

Output:


Your Answer

Interviews

Parent Categories