Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

lightning:conversationChatEnded

Event triggered when an active chat ends or an agent leaves a chat conference. This event is also triggered when using Enhanced Messaging channels.

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})