Skip to content

Latest commit

 

History

History
 
 

ToolkitAPI

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Service Cloud Voice Toolkit API

This Lightning component illustrates how to use the Service Cloud Voice Toolkit API. To learn about Service Cloud Voice, see Service Cloud Voice in Salesforce Help. Also refer to the Voice Implementation Guide.

  • Sample Component: This Aura Lightning component demonstrates the functionality of the Toolkit API.

Handling Events with This Component

The sample component illustrates some of the basic features of the Service Cloud Voice Toolkit API. To use this Lightning component in your production environment, you may have to make some changes to support your use case.

For example, if you place this component in a page layout for a VoiceCall record and you have multiple tabs showing VoiceCall records, then your component event listener will receive the same event multiple times. To avoid this situation, change how the component is implemented.

From the component file (SampleComponent.cmp), change line of code after <!-- get record data --> so that it specifies the unique VendorCallKey:

<force:recordData recordId="{!v.recordId}" layoutType="FULL" targetFields="{!v.record}" fields="VendorCallKey"/>

In your event handler code (SampleComponentHelper.js), perform a check first before running any event handling logic:

// Is this an event specific to this call?
if (!cmp.isValid() || transcript.detail.callId != cmp.get('v.record.VendorCallKey')) {
    // If not, drop out
    return
}

After making these changes, each component instance only responds to events specific to the VoiceCall record that is currently in view.