我是 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/