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
Tom in NYTom in NY 

Default timeout for a JavaScript remoting call

I am trying to change the timeout on a developer account and the timeout is always no more than 10 seconds if I set the value to 8 seconds it times out at 8 seconds, if I set the timeout to 120 seconds it times out at 10 seconds. I tried changing the timeout the following ways:
CurrentInventory.SearchMultipleProducts(partlist, 'JSON', function(result, event){
                 if (event.status && event.result) {
                  data = event.result.replace(/(&quot\;)/g,"\"");
                  console.log("data = " + data);
                  LoadMultiPartGrid(data);
                 
            }
          },{timeout: 120000 } );

and I also tried Visualforce.remoting.timeout = 120000; in javascript. Is the developers account limit 10 seconds or am I doing this wrong?

Thanks
Tom
Ashish_SFDCAshish_SFDC
Hi Tom, 


You have to use the complete Syntax, 

{ buffer: true, escape: true, timeout: 30000 }

https://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm


For this reason, we had set the parameter timeout value to other some other value than the default value i.e. 120000 milliseconds as shown below -

{buffer: true, escape: true, timeout: 120000}

The other way to do this will be to set this value at the page level as shown below -

<script type=”text/javascript”>

Visualforce.remoting.timeout = 120000; // Set timeout at page level

</script>

http://www.greytrix.com/blogs/salesforce/transaction-aborted-timeout-error-in-salesforce/


Regards,
Ashish


TomlToml
Thanks Ashish, I did try the page level as you show and that also did not work.
I ended up putting the timeout in an apex class that is calling the external web service.

So I have:
ExternalWebservice.IInventory Inventory = new ExternalWebservice.IInventory();
Inventory.timeout_x = 120000;