显示错误对话框。
Syntax
Xrm.Navigation.openErrorDialog(errorOptions).then(successCallback,errorCallback);
参数
| Name | 类型 | 必选 | Description |
|---|---|---|---|
errorOptions |
物体 | 是的 | 一个对象,用于指定错误对话框的选项。 该对象包含以下值: - details:(可选) 字符串。 有关错误的详细信息。 指定此项时,错误消息中提供了 “下载日志文件 ”按钮,单击该按钮将允许用户下载包含此值中指定的内容的文本文件。- errorCode:(可选) 数字。 错误代码。 如果刚刚设置 errorCode,则会自动从服务器检索错误代码的消息,并显示在错误对话框中。 如果指定了无效 errorCode 值,则会显示包含默认错误消息的错误对话框。- message:(可选) 字符串。 要显示在错误对话框中的消息。必须设置 errorCode 或 message 值。 |
successCallback |
函数 | 否 | 关闭错误对话框时要执行的函数。 |
errorCallback |
函数 | 否 | 作失败时要执行的函数。 |
Example
下面的代码示例传递错误的 errorCode (1234)以显示包含默认消息的错误对话框:
Xrm.Navigation.openErrorDialog({ errorCode:1234 }).then(
function (success) {
console.log(success);
},
function (error) {
console.log(error);
});
此时会显示一个包含默认消息的错误对话框: