onClickToDial() for Salesforce Classic
Registers a function to call when a user clicks an enabled phone number.
| Name | Type | Description |
|---|---|---|
listener | function | JavaScript method called when the user clicks a phone number. |
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 |
|---|---|---|
result | string | Returns the phone number, object ID, object name, and for API version 33.0 or later, the object tab name from where the click was initiated, as a JSON string. For API version 33.0 or later, invoking this method on a PersonAccount object also returns accountId or contactId, and personAccount (true if the object is a PersonAccount, false otherwise). |
error | string | If the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message. |
Example result:
Example result for a PersonAccount object (API version 33.0 and later):