1

私は慈善事業のために働き、Dynamics 365を使用して資金調達チームをサポートしたいと考えています。私たちはContactエンティティとのN:Nの関係を持つ「Fundraising Event」エンティティを作成しました(私たちの組織では「個人」に改名されました。各エンティティにサブグリッドがあります。またはイベント記録から投稿する イベントの前に幸運を祈るために、イベントに登録されたすべての人に電子メールを送信できる必要があります。「募金イベント」エンティティに対するワークフローを作成して、イベント開始の7日前に実行しましたこのテストでは、システムのジョブが「エラー;要注意」と表示され、プロセスを見ると、「送信する前に少なくとも1人の受信者がいる必要があります」というメッセージが表示されます。 Process error image WF私は使用可能なリスト(下のスクリーンショットを参照)からTOフィールドに「連絡先」と「名前付き連絡先(ルックアップ)」を使用しようとしましたが、両方とも同じ結果が得られますイオン。 To line option list image 私のテストイベントには2人の個人(連絡先)がリンクされていて、イベントレコードのサブグリッドで両方を見ることができますが、メールを送信できないようです。 ここでは詳細は失敗したプロセスから、次のとおりです。CRM - サブグリッドの連絡先に電子メールを送信

Plugin Trace: 
[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmail] 
[SendEmailStep1] 
Error Message: 
Unhandled Exception: 
System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The e-mail must have at least one recipient before it can be sentDetail: 

<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> 

<ActivityId>9161cfb2-308e-4b19-af39-b859a78f132f</ActivityId> 

<ErrorCode>-2147218684</ErrorCode> 

<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> 

<Message>The e-mail must have at least one recipient before it can be sent</Message> 

<Timestamp>2017-03-31T11:07:27.6562583Z</Timestamp> 

<ExceptionSource i:nil="true" /> 

<InnerFault> 

<ActivityId>9161cfb2-308e-4b19-af39-b859a78f132f</ActivityId> 

<ErrorCode>-2147218684</ErrorCode> 

<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> 

<Message>The e-mail must have at least one recipient before it can be sent</Message> 

<Timestamp>2017-03-31T11:07:27.6562583Z</Timestamp> 

<ExceptionSource i:nil="true" /> 

<InnerFault i:nil="true" /> 

<OriginalException i:nil="true" /> 

<TraceText i:nil="true" /> 

</InnerFault> 

<OriginalException i:nil="true" /> 

<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmail] 

[SendEmailStep1] 

</TraceText> 

</OrganizationServiceFault> 

at Microsoft.Crm.Workflow.Services.SendEmailActivityService.Execute(ActivityContext executionContext, SendEmail sendEmail) 

at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) 

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) 

それは私が箱の機能のうち、使用しようとしています何をすることは可能ですか?もしそうなら、私は何が欠けていますか? ありがとう、 ポール

+0

あなたはそれがにかなり近いはずので(すでに何らかの理由でそれを除外していない場合)、それをチェックアウトし、それが「スパム」あなたの顧客のためのものだ、標準のキャンペーンの機能を再作成しようとしているように見えますあなたが必要としているもの – Alex

+0

アレックスに感謝します。私はキャンペーンを使ってみましたが、それは本当に私たちの要件を満たしていませんが、私のリストの別のプロジェクトには確かに役立ちます。 – Paolo750f

答えて

1

ここで達成しようとしているのは、設定だけでは実現できません。このエラーは、サブグリッドにある連絡先を参照していないため、「連絡先」という名前の属性が参照されている可能性があります。この属性はおそらく空であり、エラーを引き起こしています。唯一の方法は、必要な連絡先をすべて取得して電子メールに入れるカスタムワークフローアクティビティを作成することです。あなたがコードにしたくない場合は、あなたの目標を達成するためにエイデンKaskelaのワークフロー要素を使用することができます。

https://kaskelasolutions.com/how-to-add-dynamic-recipients-to-an-email/

+0

こんにちはPawel、私はAidenのワークフロー要素を見てきましたが、電子メールの連絡先を取得して他の要素を送信することはできませんでしたので、私はカスタムワークフローの作成を見なければならないようですアクティビティ。私はデベロッパーではないので(ボックス機能を使いこなそうとしているので)、私の組織の誰かを見つけて、これを手助けする必要があります。提案にもう一度感謝します。 – Paolo750f

0

私たちは、このような何かをしました。

電子メールの事前処理でプラグインを登録メッセージ&にこのロジックがあります。

電子メールTo listにN:N contact intersectエンティティの受信者を追加します。

ConditionExpression frCondition1 = new ConditionExpression(); 
    ConditionExpression frCondition2 = new ConditionExpression(); 
    EntityCollection frResponse = new EntityCollection(); 
    EntityCollection toOwner = new EntityCollection(); 

    toOwner = targetEntity.GetAttributeValue<EntityCollection>("to"); 

    frCondition1 = CreateConditionExpression("parentIdcolummn", ConditionOperator.Equal, new string[] { parent.Id.ToString() }); 
    frCondition2 = CreateConditionExpression(statuscode, ConditionOperator.Equal, new object[] { 1 }); 

    ConditionExpression[] conditions = new ConditionExpression[] { frCondition1, frCondition2 }; 

    FilterExpression filterExpression = new FilterExpression(); 

filterExpression.Conditions.AddRange(conditions); 
filterExpression.FilterOperator = LogicalOperator.And; 

QueryExpression queryExpression = new QueryExpression(); 
queryExpression.ColumnSet = GenerateColumnSet("columnNames"); 
queryExpression.EntityName = "entityName"; 
queryExpression.Criteria = filterExpression; 
queryExpression.NoLock = true; 

    frResponse = (EntityCollection)service.RetrieveMultiple(queryExpression); 

    if(frResponse != null && frResponse.Entities.Count > 0) 
    { 
     //Adding all FRs in the email 
     foreach (Entity FilingRep in frResponse.Entities) 
     { 
      Guid frGuid = ((EntityReference)FilingRep["contactLookupfieldname"]).Id; 

      Entity toParty = new Entity("activityparty"); 

      toParty[ActivityParty.ActivityPartId] = new EntityReference("contact", frGuid); 

      ToOwner.Entities.Add(toParty); 
     } 
    } 

    targetEntity[EmailEntityAttributeName.To] = toOwner; 
関連する問題