Sales Engagement Methods for Lightning Experience

These two methods allow your CTI implementation to communicate with Sales Engagement to handle Sales Engagement work. The onWorkStart method lets you listen for when a Sales Engagement work item starts. You communicate back to Sales Engagement with the completeWork method when the work completes. These methods are available in API version 46.0 or later.

You can use this method with the Lightning web component lightning-click-to-dial. You can also use it with the Aura component lightning:clickToDial. Keep in mind that you can’t use either component in iFrames. This method can’t be used with the Visualforce component support:clickToDial.

CallEnd is deprecated as of API version 48.0.

The onWorkStart method lets you listen for when work starts. Sales Engagement calls your listener function when the work starts. In your listener, the completeWorkWhen parameter specifies whether to call Sales Engagement back when the task is saved (TaskSaved).

When the work completes (when the task is saved), call the completeWork method so that the Sales Engagement system can update its information.

Only call this method for outbound calls. Inbound calls aren’t started by Sales Engagement.

Arguments for onWorkStart:

NameTypeDescription
listenerfunctionFunction that is called when the work is started. This function’s payload includes workId, completeWorkWhen, attributes, and to.
workIdstringID of the work item. Depending on the type of work, this value is either the step tracker ID or the my list ID.
completeWorkWhenstringDefines when to call the completeWork method. This value is TaskSaved.
attributesobjectAttributes object that contains the to field.
tostringThis field is used to link to the number in onClickToDial.

Arguments for completeWork:

NameTypeDescription
workIdstringID of the work item. Use the same value that you previously received in onWorkStart.
attributesobjectAttributes object that can contain the following fields: disposition, taskId, wasConnected.
dispositionstringValue of the disposition. Required when completeWorkWhen is TaskSaved.
taskIdstringID of the task. Required when completeWorkWhen is TaskSaved.
wasConnectedbooleanIndicates whether the call successfully connected. We recommend always passing this value. If not passed, the value defaults to true.
callbackfunctionFunction executed when the call completes.

Listen for Sales Engagement work to start:

Call Sales Engagement when a task is saved: