Asynchronous Calls with the Salesforce Console Integration Toolkit

The Salesforce Console Integration Toolkit lets you issue asynchronous calls. Asynchronous calls allow the client-side process to continue instead of waiting for a callback from the server. To issue an asynchronous call, you must include an additional parameter with the API call, which is referred to as a callback function. Once the result is ready, the server invokes the callback method with the result.

Asynchronous syntax:

1method('ARG1','ARG2', ..., CALLBACK_METHOD);

Where ARG1, ARG2, and CALLBACK_METHOD are variables.

For example:

1//Open a new primary tab with the Salesforce home page in it
2   sforce.console.openPrimaryTab(null, 'https://salesforce.com', 
3      false, 'Salesforce', callback);