Salesforce logSalesforce
PDF

notifyInitializationComplete() for Lightning Experience

Usage

Notifies Salesforce that the softphone initialization is complete and that Salesforce should not switch to a standby URL. While the softphone initializes, a loading icon displays in the softphone area. To use a standby URL, you must specify the reqStandbyUrl and reqTimeout fields, in the call center’s definition file. For more information, see Optional Call Center Elements and Attributes

The notifyInitializationComplete() method for Lightning Experience works differently from the Salesforce Classic method.
  • In Lightning Experience, the method takes an optional callback object. In Salesforce Classic, the method doesn't take arguments.
  • In Lightning Experience, after you go to the standby URL your browser session continues to use that standby URL. To force the standby URL check, you must restart the browser—close it and open it again. In Salesforce Classic, the standby URL check was completed only after you logged in to Salesforce, and the check wasn't repeated if you kept using the same Salesforce session.

Syntax

sforce.opencti.notifyInitializationComplete({
     callback: function //Optional
});

Arguments

Name Type Description
callback function JavaScript method executed when the API method call is completed.

Sample Code–HTML and JavaScript

<html>
  <head>
    <script type="text/javascript" src="http://domain:port/support/api/53.0/lightning/opencti_min.js"></script>
    <script type="text/javascript">
      // Invokes API method
      sforce.opencti.notifyInitializationComplete();
    </script>
  </head>
  <body>
    The Open CTI framework was notified that the softphone initialization is complete.
  </body>
</html>

Response

This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.

Name Type Description
success boolean Returns true if the API method call was invoked successfully, false otherwise.
returnValue object This API method doesn’t return this object. The returnValue is always null.
errors array If the API call was successful, this variable is null. If the API call failed, this variable returns an array of error messages.