sendCustomEvent() for Lightning Experience

Sends a custom event to the client-side chat window for a chat with a specific chat key. This method works only in Lightning console apps.

NameTypeDescription
argumentObjObjectAn object containing all the arguments to be passed into this method.
NameTypeDescription
recordIdStringThe ID of the event that you want to customize.
typeStringThe name of the custom event type.
dataStringThe data attached to the custom event.

This example publishes a custom event and logs the result.

Component Code:

Controller Code:

The custom event type must match the name of your custom event. Replace myCustomEventType with your own custom event name.

Returns a Promise. Success is indicated if the promise is fulfilled. Failure is indicated if the catch clause is invoked.