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
BhatiaBhatia 

Trigger for inactivity on the page for 15 minutes.

After 15 minutes of inactivity on the page, I need to fire a Trigger which can refresh the page, so that I can avoid the timeout error.

I am getting Invalid Query Locator Error and it showing 5 limit per user. To avoid this error I want to get some workaround or if it can achieved by jquery. please assist me in solving this.

 

Any help will be appreciable.

 

Thanks

bob_buzzardbob_buzzard

There are various ways to achieve this, for example using an actionpoller to execute an action method on the controller after 900 seconds.  However, the suitability of the methods depends on what else your page is doing. For example, if the user is filling in a complex form, you don't want to postback the page under their feet.

BhatiaBhatia

Thanks for the response.

 

I am performing Pagination  when we click on Edit All button, it gives us few records to edit the details in it after that one user becomes inactive for 15 minutes when he clicks on the next button for fetching the new records to edit, it throws the error:

 

Invalid Query Locator Error : 5 limit per user.

 

As i am using the getQueryLocator method for handling the records. By its property, it is inactivated after 15 minutes. I want to activate it by the page refresh or how to get 6th cursor alive if all 5 cursors of getquerylocator inactivated.

 

Thanks

bob_buzzardbob_buzzard
You could use an action poller with a 900 second interval. If you don't want to submit the user's edits you could place it in it's own actionregion. Do you have to interact with the query locator in order to keep it alive?
BhatiaBhatia

Yes you are  right. I want to keep it alive.

 

Thanks

bob_buzzardbob_buzzard

Sorry, not being clear.  The final question was intended to ask if you need to invoke a method or similar on the query locator in order to keep it alive, or if keeping the Salesforce session alive is enough.

 

If you do need to invoke a method, you'll need to add that to the action method called from the actionpoller component.

BhatiaBhatia

If you can please tell me what action i need to take the queryLocator alive in the apex class on the server side .



bob_buzzardbob_buzzard

That's what I was asking you :)  If you are using a standardsetcontroller for this I suspect you'll have to experiment with the methods that makes available to see if any of them keep the querylocator alive.