Newer Version Available

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

lightning:omniChannelWorkClosed

Indicates that an agent has closed a tab in the console that’s associated with a work item. When the tab is closed, the status of the AgentWork object associated with it automatically changes to Closed.

Response

Name Type Description
workItemId string The ID of the object that’s routed through Omni-Channel. This object becomes a work assignment with a workId when it’s assigned to an agent.
workId string The ID of a work assignment that’s routed to an agent.

Example

This example prints work details to the browser’s developer console when an Omni-Channel user closes a tab in the console that’s associated with a work item.

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:omniToolkitAPI aura:id="omniToolkit" />  
3    <aura:handler event="lightning:omniChannelWorkClosed" action="{! c.onWorkClosed }"/>
4</aura:component>

Controller code:

1({
2    onWorkClosed : function(component, event, helper) {
3        console.log("Work closed.");
4        var workItemId = event.getParam('workItemId');
5        var workId = event.getParam('workId');
6        console.log(workItemId);
7        console.log(workId);
8    }, 
9})