Newer Version Available

This content describes an older version of this product. View Latest

lightning:conversationChatEnded

Event triggered when an active chat ends or an agent leaves a chat conference.

Response

Name Type Description
recordId String The ID of the work record that’s associated with the current chat.

Example

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" description="Conversation toolkit api sample">
2  <lightning:conversationToolkitAPI aura:id="conversationKit" />
3  <aura:handler event="lightning:conversationChatEnded" action="{!c.onChatEnded}" />
4</aura:component>

Controller code:

1({
2    onChatEnded: function(cmp, evt, helper) {
3        var conversation = cmp.find("conversationKit");
4        var recordId = evt.getParam("recordId");
5
6        console.log("recordId:" + recordId);
7    }
8})