Sample Code:
Aura Component:
<aura:component implements=”flexipage:availableForAllPageTypes” access=”global”>
<lightning:omniToolkitAPI aura:id=”omniToolkit” />
<lightning:conversationToolkitAPI aura:id=”conversationKit”/>
<aura:handler event=”lightning:omniChannelWorkAccepted” action=”{!c.onWorkAccepted}”/>
</aura:component>
<lightning:omniToolkitAPI aura:id=”omniToolkit” />
<lightning:conversationToolkitAPI aura:id=”conversationKit”/>
<aura:handler event=”lightning:omniChannelWorkAccepted” action=”{!c.onWorkAccepted}”/>
</aura:component>
JavaScript Controller:
({
onWorkAccepted:function( component,event,helper ) {
console.log( ‘Inside the Work Acceptance’ );
let transcriptId = event.getParam( ‘workItemId’ );
console.log( ‘Chat Transcript Id is ‘ + transcriptId );
if ( transcriptId ) {
let conversationToolKitAPI=component.find( “conversationKit” );
conversationToolKitAPI.getDetailsByRecordId( {
recordId: transcriptId
} ).then( function( result ) {
if ( result ) {
console.log( ‘Result: ‘ + JSON.stringify( result ) );
}
});
}
}
})
onWorkAccepted:function( component,event,helper ) {
console.log( ‘Inside the Work Acceptance’ );
let transcriptId = event.getParam( ‘workItemId’ );
console.log( ‘Chat Transcript Id is ‘ + transcriptId );
if ( transcriptId ) {
let conversationToolKitAPI=component.find( “conversationKit” );
conversationToolKitAPI.getDetailsByRecordId( {
recordId: transcriptId
} ).then( function( result ) {
if ( result ) {
console.log( ‘Result: ‘ + JSON.stringify( result ) );
}
});
}
}
})
Aura Component Configuration in App:
Output: