onClickToDial() for Lightning Experience
Registers a function to call when a user clicks an enabled phone number. This method is available in API version 38.0 or later.
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.
| Name | Type | Description |
|---|---|---|
listener | function | JavaScript method called when the user clicks an enabled phone number. |
The payload object passed to each call to the listener method contains the following fields.
| Name | Type | Description |
|---|---|---|
number | number | Provides the phone number clicked by the user. |
recordId | string | Provides the ID of the record associated with the clicked phone number. |
recordName | string | Provides the name of the record for the clicked phone number. |
objectType | string | Provides the type of record associated with the clicked phone number. |
accountId or contactId | string | If the clicked phone number belongs to a person account, the associated account or contact ID is provided. |
personAccount | boolean | If the clicked phone number belongs to a person account, this property is true.If person accounts aren’t enabled in your org, this field isn’t included in the payload object. |
params | string | Comma-separated list of parameters associated with the phone number passed into the component. |