Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Timeout Parameter for Asynchronous Calls
If an asynchronous call does not complete in an appropriate amount of time, you can
end the call. To do this, specify the timeout
parameter in the callback section of any asynchronous call.
1var account = new sforce.SObject("Account");
2account.Name = "my new account";
3
4sforce.connection.create([account], {onSuccess: print, onFailure: printerr, timeout: 100});Values for this parameter are in milliseconds, and valid values are integers beginning with 1.
If the call is successful within the time specified by the callout, no additional actions are taken. If the call is not successful, the onFailure action is performed.