I have a custom activity entity in CRM 2106. I want to send an email after the Actual End field value changes, but the workflow throws an error when it fires:
Creating Entity with an invalid parent. Entity: Email, ReferencingAttribute:regardingobjectid
Plugin Trace:
[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmailFromTemplate]
[SendEmailStep5: Send Office 365 Follow up Email]
Error Message:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Creating Entity with an invalid parent. Entity: Email, ReferencingAttribute:regardingobjectidDetail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220987</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Creating Entity with an invalid parent. Entity: Email, ReferencingAttribute:regardingobjectid</Message>
<Timestamp>2017-08-05T18:37:37.748118Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220987</ErrorCode>
<ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Creating Entity with an invalid parent. Entity: Email, ReferencingAttribute:regardingobjectid</Message>
<Timestamp>2017-08-05T18:37:37.748118Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmailFromTemplate]
[SendEmailStep5: Send Office 365 Follow up Email]
</TraceText>
</OrganizationServiceFault>
at Microsoft.Crm.Workflow.Services.SendEmailFromTemplateActivityService.Execute(ActivityContext executionContext, SendEmailFromTemplate sendEmailFromTemplate)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Is it not possible to use a workflow to send an email when it involves the creation or update of an Activity record? I looked at the entity record under Communication and Collaboration, and "Sending email" option is not available for selection. This is also true on Phone Call and appointment activity types. Does anyone have a suggestion for a workaround?
*This post is locked for comments
I have the same question (0)Hi,
if it's a custom workflow activity, what goes into the regarding objectid when you are creating an email? Looking at the error message, I'm wondering if you are trying to make that email regarding a phone call.. which is not allowed (can't make an activity regarding another activity)