Dynamics 365 渠道集成框架 2.0 的 cancelEvent(JavaScript API 参考)

根据取消令牌取消有关传入对话的通知。

Syntax

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

参数

Name 类型 必选 Description
取消令牌 String 是的 方法中 notifyEvent 提供的唯一字符串,用于显示有关传入对话的通知。
correlationId GUID 用于将所有相关 API 调用分组在一起以进行诊断遥测。
success回调 功能 请求成功时要调用的函数。 回调成功后,响应对象将包含取消令牌。
errorCallback 功能 请求失败时要调用的函数。

回调函数详细信息

以下对象被传递到 and successCallbackerrorCallback 函数中。

successCallback 函数

返回取消令牌。

errorCallback 函数

示例 JSON 对象:

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

参数

消息 Description
拒绝客户端错误后 发生未知异常(当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
                }
);