Lightning Experience の High Velocity Sales (HVS) メソッド
使用方法
次の 2 つのメソッドを使用すると、CTI 実装を通じて High Velocity Sales (HVS) と通信し、HVS 作業を処理できます。onWorkStart メソッドでは、HVS 作業項目の開始をリスンできます。作業が完了したら、completeWork メソッドを使用して、HVS と再び通信します。これらのメソッドは、API バージョン 46.0 以降で使用できます。
構文
onWorkStart メソッドでは、作業の開始をリスンできます。HVS は、作業の開始時にリスナ関数をコールします。 In your listener, the completeWorkWhen parameter specifies whether you should call HVS back when the task is saved (TaskSaved).
1sforce.opencti.hvs.onWorkStart({listener: function});
2
3{ // Listener function payload
4 workId: string, // Id of the current work
5 completeWorkWhen: string, // 'TaskSaved'
6 attributes: {
7 to: string // Used to match to click_to_call
8 }
9}When the work completes (when the task is saved), call the completeWork method so that the HVS system can update its information.
1sforce.opencti.hvs.completeWork({
2 workId: string, // Id from onWorkStart
3 attributes: {
4 disposition: string, // Only needed for task
5 taskId: string,
6 wasConnected: boolean, // Should be added, otherwise defaults to true
7 },
8 callback: function
9});引数
onWorkStart の引数を次に示します。
| 名前 | 型 | 説明 |
|---|---|---|
| listener | function | 作業の開始時にコールされる関数。この関数のペイロードには、workId、completeWorkWhen、attributes、to が含まれます。 |
| workId | string | 作業項目の ID。この値は、作業種別に応じて、ステップトラッカー ID と私のリスト ID のいずれかになります。 |
| completeWorkWhen | string | completeWork メソッドをいつ呼び出す必要があるかを定義します。 This value is TaskSaved. |
| attributes | object | to 項目を含む Attributes オブジェクト。 |
| to | string | この項目は、onClickToDial の数値にリンクするために使用されます。 |
completeWork の引数を次に示します。
| 名前 | 型 | 説明 |
|---|---|---|
| workId | string | 作業項目の ID。以前 onWorkStart で受け取ったのと同じ値を使用します。 |
| attributes | object | disposition、taskId、wasConnected の各項目を含むことができる Attributes オブジェクト。 |
| disposition | string | 配置の値。completeWorkWhen が TaskSaved の場合に必要です。 |
| taskId | string | タスクの ID。completeWorkWhen が TaskSaved の場合に必要です。 |
| wasConnected | boolean | コールの接続が成功したかどうかを示します。 We recommend always passing this value. If not passed, the value defaults to true. |
| callback | function | コールの完了時に実行される関数。 |
サンプルコード
HVS 作業の開始をリスンします。
1sforce.opencti.hvs.onWorkStart({
2 listener: function(payload) {
3 var workId = payload.workId; // Save the work ID
4 var whenVal = payload.completeWorkWhen; // Save the completion requirement
5 var toVal = payload.attributes.to; // Save the number to associate with onClickToDial
6 }
7});タスクの保存時に HVS をコールします。
1sforce.opencti.hvs.completeWork({
2 workId: a07B0000006VFHrIAO, // Id sent via onWorkStart
3 attributes: {
4 disposition: 'Completed', // Disposition value
5 taskId: '00TR00000032yfVMAQ' // ID of task created
6 wasConnected: true // Whether the call successfully connected
7 },
8 callback: function() { /* perform cleanup here */ }
9});