【发布时间】:2014-02-25 15:54:20
【问题描述】:
在 CRM 2011 中,我想使用插件将电子邮件活动的描述导出为 doc 文件。插件执行后出现以下问题:
问题:它禁用了电子邮件活动表单。
以下是我目前为止的插件代码。
IPluginExecutionContext context = (IPluginExecutionContext)isp.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory factory = (IOrganizationServiceFactory)isp.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = factory.CreateOrganizationService(context.UserId);
ITracingService t_service = (ITracingService)isp.GetService(typeof(ITracingService));
service.Update(entity);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
Entity entity = (Entity)context.InputParameters["Target"];
string strFileName = subject + ".doc";
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentType = "application/msword";
StringBuilder strHTMLContent = new StringBuilder();
strHTMLContent.Append(html);
HttpContext.Current.Response.Write(strHTMLContent);
HttpContext.Current.ApplicationInstance.CompleteRequest();
HttpContext.Current.Response.Flush();
我想在这方面寻求您的帮助,使其无法禁用电子邮件活动表单。
【问题讨论】:
-
“停止电子邮件活动表单”是什么意思?
-
意思是在我刷新表单之前禁用表单
-
更新您的问题,然后成为您的意思。
-
所以基本上,你点击保存,它永远不会完成?只是坐在那里挂着,等待实体拯救?
-
我已经更新了我的问题。它会生成 word 文件并允许我在弹出窗口中下载、打开或取消,但表单会被禁用。
标签: c# plugins dynamics-crm-2011