9

現在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.");
        }
    } 
}
4

2 に答える 2