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.

NameTypeDescription
listenerfunctionJavaScript 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.

NameTypeDescription
numbernumberProvides the phone number clicked by the user.
recordIdstringProvides the ID of the record associated with the clicked phone number.
recordNamestringProvides the name of the record for the clicked phone number.
objectTypestringProvides the type of record associated with the clicked phone number.
accountId or contactIdstringIf the clicked phone number belongs to a person account, the associated account or contact ID is provided.
personAccountbooleanIf 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.
paramsstringComma-separated list of parameters associated with the phone number passed into the component.