web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Workflow to send email when record fields change on custom activity fails: Invalid parent

(0) ShareShare
ReportReport
Posted on by

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)
  • Suggested answer
    ashlega Profile Picture
    34,477 on at
    RE: Workflow to send email when record fields change on custom activity fails: Invalid parent

    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)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans