小编Hug*_*lva的帖子

如何在不使用InvalidPluginExecutionException的情况下通过插件向用户发送警报?

我目前正在使用InvalidPluginExecutionException该消息发送给用户,但事实证明该消息是英文的,"Business Process Error"超出该消息的错误框出现在按钮上"download log file".这不是错误,因为用户正在尝试复制记录,如代码中所示.还有其他方法,而不必使用InvalidPluginExecutionException显示警报?

QueryExpression query1 = new QueryExpression();
query1.ColumnSet = new ColumnSet(true);
query1.EntityName = "new_appraisers";

EntityCollection ec = service.RetrieveMultiple(query1);

if (ec.Entities.Count <= 0)
{
    log.Tb_Log_Create("Appraiser created");
}
else
{
    foreach (Entity app in ec.Entities)
    {
        if (app["fcg_appraiser"].ToString() == name)
        {
            log.Tb_Log_Create("appraiser allready exist");

            throw new InvalidPluginExecutionException("The name allready exists");
        }

        if (app["new_login"].ToString() == login)
        {
            log.Tb_Log_Create("appraiser allready exist");

            throw new InvalidPluginExecutionException("The login allready exists.");
        }
    } 
}
Run Code Online (Sandbox Code Playgroud)

c# plugins crm dynamics-crm-2011

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

crm ×1

dynamics-crm-2011 ×1

plugins ×1