Skip to main content
amol navthale が「#Visualforce」で質問
Hi ,

I am getting the timeout error in VFRemoting, event after incresing the timeout to = 120000.

my requirement to get data list from remote method.

Method does the aggregate SOQL on case for one year data.

case object has millions of data, so to avoid limit excepetion i had formed 12 SOQL for each month and club all data and retrun that data.

As this operation takes more time to excecute getting the timeout error.

so is their any way to avoid this error or any other approach to achive this.

 
1 件の回答
  1. 2016年2月3日 12:51
    Try offsetting your data. Here is an example of how you can do it.

     

    @RemoteAction public static SObject[] getRecords(Id offsetId) {

    if(offsetId==null) {

    return [SELECT Id,Name FROM Contact ORDER BY Id ASC LIMIT 100];

    } else {

    return [SELECT Id,Name FROM Contact WHERE ID > :offsetId ORDER BY Id ASC LIMIT 100];

    }

    }

    This way you can limit the data that is retrieved and the response can be quicker.

    Hope this helps.

     
0/9000