Dynamics 365 Channel Integration Framework 2.0 的 cancelEvent (JavaScript API 參考)

根據取消權杖取消有關傳入交談的通知。

語法

Microsoft.CIFramework.cancelEvent(cancellationToken, correlationId).then(successCallback, errorCallback);

參數

名稱 類型 為必填項目 Description
取消權杖 繩子 Yes 方法中 notifyEvent 提供的唯一字串,以顯示傳入交談的通知。
correlationId GUID 否 用來將所有相關的 API 呼叫分組在一起,以進行診斷遙測。
successCallback 回調 功能 否 請求成功時要呼叫的函式。 成功回呼時,回應物件將包含取消權杖。
errorCallback 回調 功能 否 請求失敗時要呼叫的函數。

回呼函式詳細資料

下列物件會傳遞至 and successCallbackerrorCallback 函數。

successCallback 函式

傳回取消權杖。

errorCallback 函數

範例 JSON 物件:

{
	"message" : "<error details>",
	"msdyn_name" : "CancelEvent"
}

參數

訊息 Description
RejectAfterClientError 發生未知例外狀況(當Platform API呼叫失敗或遺漏某些輸入引數時發生)

Example

// Trying to cancel a notification, use the same cancelToken passed during creation of notification in notifyEvent
Microsoft.CIFramework.cancelEvent(CancelToken).then(
                function success(result) {
                                console.log(result);
                                // Perform operations
                },
                function (error) {
                                console.log(error.message);
                                // Handle error conditions
                }
);