Hello,
I published a case follow-up survey and used the snippet in a workflow which sends e-mails to case contacts asking to complete the survey. The workflow is triggered at case completion but when I complete a case process, I get the below error.
It basically says that I need a `To` field but in the workflow it's been populated by case contact.
Has anyone come across this kind of problem before?
Regards
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: To generate a survey unique code, send an individual email to each participant. Microsoft.Xrm.Sdk.InvalidPluginExecutionException: The "To" field is required to have any of these (contact/account/lead/systemuser) type of participant send an invitation.!
at Microsoft.Crm.Surveys.Plugins.InvitationPlugin.CreateInvitationAddressees(Entity invitation, EntityCollection to, String invitationToMultipleRecipientsMessage, VocPluginContext vocPluginContext) (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>43cc7238-307f-42bb-9aa1-e0cab1f395ee</ActivityId>
<ErrorCode>-2147220891</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>OperationStatus</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">0</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>SubErrorCode</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">-2146233088</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: To generate a survey unique code, send an individual email to each participant. Microsoft.Xrm.Sdk.InvalidPluginExecutionException: The "To" field is required to have any of these (contact/account/lead/systemuser) type of participant send an invitation.!
at Microsoft.Crm.Surveys.Plugins.InvitationPlugin.CreateInvitationAddressees(Entity invitation, EntityCollection to, String invitationToMultipleRecipientsMessage, VocPluginContext vocPluginContext) (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).</Message>
<Timestamp>2017-05-24T00:02:19.3030088Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText>
[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.GlobalActiveStagePlugin]
[bb48066e-f22f-412f-a530-91f72e4b859b: GlobalActiveStagePlugin]
[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.WorkflowEventPlugin]
[3844d008-ef45-413a-a8b0-549bb10046b9: WorkflowEventPlugin]
[Microsoft.Crm.ObjectModel: Microsoft.Crm.Extensibility.InternalOperationPlugin]
[46f6cf4c-14ae-4f1e-98a1-eae99a37e95c: ExecuteWorkflowWithInputArguments]
Starting sync workflow 'Post-case-survey', Id: ef4fe332-1440-e711-810e-c4346bc58654
Entering SendEmailStep1_step:
Sync workflow 'Post-case-survey' terminated with error 'System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: To generate a survey unique code, send an individual email to each participant. Microsoft.Xrm.Sdk.InvalidPluginExecutionException: The "To" field is required to have any of these (contact/account/lead/systemuser) type of participant send an invitation.!
at Microsoft.Crm.Surveys.Plugins.InvitationPlugin.CreateInvitationAddressees(Entity invitation, EntityCollection to, String invitationToMultipleRecipientsMessage, VocPluginContext vocPluginContext) (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).'
</TraceText>
</OrganizationServiceFault>
*This post is locked for comments