是否可以无提示地停止MS CRM 2011中的插件执行? [英] Is it possible to stop plugin execution in MS CRM 2011 silently?

查看:53
本文介绍了是否可以无提示地停止MS CRM 2011中的插件执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在不引发异常的情况下停止执行MS CRM插件?

Is it possible to stop execution of MS CRM plugins without firing exception?

我想禁止用户操作,因此创建了插件列表 Pre 事件步骤。我计划在 Pre 步骤之后取消所有其他操作。

I want to forbid user action and thus created plugin listing Pre event step. My plan it to cancel all further actions after that Pre step.

我该如何实现?当然,不显示错误消息。

How could I achieve this? Without showing error message, of course.

推荐答案

不幸的是,停止执行并回滚插件内部更改的唯一方法是抛出异常( InvalidPluginExecutionException

Unfortunately the only way to stop execution and rollback the changes inside a plugin is to throw an exception (InvalidPluginExecutionException)

如果插件注册为同步,则异常将始终显示错误消息,并且

If the plugin is registered as synchronous the exception will always show the error message and is not possible to hide it.

如果插件注册为异步,则将异常写入 AsyncOperation 实体

If the plugin is registered as asynchronous the exception is written to the AsyncOperation entity

有关更多信息:

MSDN-处理插件中的异常

这篇关于是否可以无提示地停止MS CRM 2011中的插件执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆