我目前正在使用InvalidPluginExecutionException
将消息发送给用户,但事实证明该消息是英文的,"Business Process Error"
超出此错误框会出现 button "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.");
}
}
}