---
schema_version: "1"
id: 189c99391dbbe504ab16365e7742ad42fc258cd8b99903a56f9735075f175939
title: disableClickToDial() for Lightning Experience
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/api-cti/guides/sforce-api-cti-disableclicktodial-lex.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-disableclicktodial-lex.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7b3742d13638ea733a4da4d8a0e5a6ae1a47f118032566ca42f0e093cf4b410a
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# disableClickToDial() for Lightning Experience

## Usage

Disables click-to-dial. This method is available in API version 38.0 or later.

**note:** You can use this method with the Lightning web component `lightning-click-to-dial`. You can also use it with the Aura component `lightning:clickToDial`. Keep in mind that you can’t use either component in iFrames. This method can’t be used with the Visualforce component `support:clickToDial`.

## Syntax

```javascript
sforce.opencti.disableClickToDial({
     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 set_clipboard -->
```html
<html>
  <head>
    <script type="text/javascript" src="https://domain:port/support/api//lightning/opencti_min.js"></script>
    <script type="text/javascript">
      var callback = function(response) {
         if (response.success) {
            console.log('API method call executed successfully! returnValue:', response.returnValue);
         } else { 
            console.error('Something went wrong! Errors:', response.errors);
         } 
      };

      function disableClickToDial() {
          sforce.opencti.disableClickToDial({callback: callback});
      }
     </script>
  </head>
  <body>
    <button onclick="disableClickToDial();">disableClickToDial()</button>
  </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](https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-error-messages-lightning.md).|


