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:conversationCustomEvent

Event triggered when a custom event occurs during a chat.

Response

Name Type Description
recordId String The ID of the work record that’s associated with the current chat.
type String The type of the custom event that was sent to this chat; corresponds to the type argument of the liveagent.chasitor.sendCustomEvent() method used to send this event from the chat window.
data String The data of the custom event that was sent to this chat; corresponds to the data argument of the liveagent.chasitor.sendCustomEvent() method used to send this event from the chat window.

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:conversationCustomEvent" action="{!c.onCustomEvent}" />
4</aura:component>

Controller code:

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