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
KitagawaSan85KitagawaSan85 

Speed up load time for inline vf page

Hi, 

 

I have been trying to improve the load times of our account records and am finding that one of our inline visual force pages is taking some time to load. Is is possible to load the standard detail page and the vf page independently from eachother? 

 

I know part of the issue is the controller extention that runs to gather some additional information, but any pointers in the right direction would be greatly appreciated! 

 

Controller Extension: 

public class AccountExt {

    private final Account acc;
    
    public AccountExt(ApexPages.StandardController stdController) {
        this.acc = (account)stdController.getRecord();
    }
    
    public integer getOpenTasks() {
        return [SELECT count() FROM task WHERE whatid = :acc.id and IsClosed=false];
    }  
    
    public decimal getParFunnel() { 
    	if(acc.Rep_Site_18_Accnt_ID__c == null){
    		AggregateResult at = [SELECT Sum(Lic_Revenue__c)t FROM opportunity WHERE Account.Ultimate_Parent_ID__c = :acc.Ultimate_Parent_ID__c and IsClosed = false and Lic_Revenue__c > 0];
        	if ( at.get('t') == null) {return 0;} else {return (decimal)at.get('t');}
        }else{
        	AggregateResult at = [SELECT Sum(Lic_Revenue__c)t FROM opportunity WHERE Account.Rep_Site_18_Accnt_ID__c = :acc.Rep_Site_18_Accnt_ID__c and IsClosed = false and Lic_Revenue__c > 0];
        	if ( at.get('t') == null) {return 0;} else {return (decimal)at.get('t');}
        }
    }
    
    public decimal getParUsers() {
        AggregateResult au = [SELECT Sum(Std_User_Count__c)u FROM account WHERE Rep_Site_18_Accnt_ID__c = :acc.Rep_Site_18_Accnt_ID__c and Rep_Site_18_Accnt_ID__c != null  and Status__c = 'Active' and Std_User_Count__c > 0];
        if ( au.get('u') == null) {return 0;} else {return (decimal)au.get('u');}
    }
}