error-handling - 在 Dynamics AX 2012 中显示自定义错误消息

标签 error-handling microsoft-dynamics axapta dynamics-ax-2012 custom-error-handling

我是 AX 的新手,想知道如何显示自定义错误消息或警告。我一直在寻找解决方案,并在 msdn 链接中找到了以下内容;

You can optionally display a custom error message in a dialog of the Web application by having your plug-in throw an InvalidPluginExecutionException exception with the custom message as the Message property value.

但我不知道如何使用它。

可以this link对完成这项任务有帮助吗?

最佳答案

AX 中的警告和错误消息由信息日志系统处理。在 X++ 中,您使用 info , warning , 或 error向信息日志添加消息的方法。通常,您会抛出这些方法的返回值以生成异常:

throw error("My error message.");

在企业门户页面上,大多数页面都会有一个信息日志 Web 部件。您可以使用 .NET Business Connector 代理中的信息对象将消息添加到信息日志。见题目Using the Infolog在 MSDN 中。

关于error-handling - 在 Dynamics AX 2012 中显示自定义错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12605952/

相关文章:

PHP 关闭错误 - 仅在一个文件中

c# - 如何访问源错误、源文件和异常的行号以在自定义错误页面中使用?

axapta - 如何从另一个容器中获取一个容器?

web-services - 为什么 Dynamics AX 客户端在部署服务组后停止工作?

axapta - 通过 AOT 中的查询进行订购

dynamics-ax-2009 - 表=表与表.数据(表)

java - 错误的 catch block 运行

javascript - 在带有异步的 Nodejs 中使用自定义错误

dynamics-crm-2011 - Dynamics CRM - 可能性和局限性

javascript - Dynamics CRM Javascript 使表单只读 -TypeError : control. getDisabled 不是函数