public with sharing class AccountVisitCountController { public Account2__c acc2 { get; private set; } public AccountVisitCountController(ApexPages.StandardController stdController) { Id recordId = stdController.getId(); acc2 = [ Select Id, VisitCountThisFiscalYear__c, ThisYear1__c, ThisYear2__c, ThisYear3__c, ThisYear4__c, ThisYear5__c, ThisYear6__c, ThisYear7__c, ThisYear8__c, ThisYear9__c, ThisYear10__c, ThisYear11__c, ThisYear12__c, DoOPDHospital_ThisYear__c, DoOPDHospital_ThisYear1__c, DoOPDHospital_ThisYear2__c, DoOPDHospital_ThisYear3__c, DoOPDHospital_ThisYear4__c, DoOPDHospital_ThisYear5__c, DoOPDHospital_ThisYear6__c, DoOPDHospital_ThisYear7__c, DoOPDHospital_ThisYear8__c, DoOPDHospital_ThisYear9__c, DoOPDHospital_ThisYear10__c, DoOPDHospital_ThisYear11__c, DoOPDHospital_ThisYear12__c, DoNTCHospital_ThisYear__c, DoNTCHospital_ThisYear1__c, DoNTCHospital_ThisYear2__c, DoNTCHospital_ThisYear3__c, DoNTCHospital_ThisYear4__c, DoNTCHospital_ThisYear5__c, DoNTCHospital_ThisYear6__c, DoNTCHospital_ThisYear7__c, DoNTCHospital_ThisYear8__c, DoNTCHospital_ThisYear9__c, DoNTCHospital_ThisYear10__c, DoNTCHospital_ThisYear11__c, DoNTCHospital_ThisYear12__c, This_year_inspection_times_formula__c, This_year_inspection_times1__c, This_year_inspection_times2__c, This_year_inspection_times3__c, This_year_inspection_times4__c, This_year_inspection_times5__c, This_year_inspection_times6__c, This_year_inspection_times7__c, This_year_inspection_times8__c, This_year_inspection_times9__c, This_year_inspection_times10__c, This_year_inspection_times11__c, This_year_inspection_times12__c, This_year_inspection_count_formula__c, This_year_inspection_count1__c, This_year_inspection_count2__c, This_year_inspection_count3__c, This_year_inspection_count4__c, This_year_inspection_count5__c, This_year_inspection_count6__c, This_year_inspection_count7__c, This_year_inspection_count8__c, This_year_inspection_count9__c, This_year_inspection_count10__c, This_year_inspection_count11__c, This_year_inspection_count12__c from Account2__c where Account_Org__c = :recordId]; } }