微软CRM4.0Plugin抛出异常信息实现换行功能
时间:2010-10-14 来源:Batistuta Cai
function HTMLMessage()
{
var ErrorMessage = document.getElementById("ErrorMessage");
ErrorMessage.innerHTML = ErrorMessage.innerText;
}
3、在onload事件中调用HTMLMessage函数,代码如下:
<body onload="HTMLMessage()">
4、保存
5、新建一个Plugin,抛出一个异常,并显示HTML格式消息,代码如下:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.Sdk.Query;
using Microsoft.Crm.SdkTypeProxy;
namespace HtmlMessagePluginException
{
public class PluginException : IPlugin
{
public void Execute(IPluginExecutionContext context)
{
throw new InvalidPluginExecutionException("<strong style=\"font-size:16px;color:#0067c6;\">提供支持HTML的异常信息</strong> <BR> <strong style=\"font-size:16px;color:#0067c6;\">很好很强大!</strong>");
}
}
}
6、注册到微软CRM4.0
7、运行结果如下图:
相关阅读 更多 +
排行榜 更多 +










