Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

Error while sending email via Workflow

(0) ShareShare
ReportReport
Posted on by 790

dear all

i do have a workflow that sends email to the new owner whenever a case is reasigned, it was working fine, now it is not working.

please check below.

2018_2D00_11_2D00_06-14_5F00_22_5F00_15_2D00_System-Job_5F00_-_5F00_Notify-User-when-case-is-re_2D00_Assigned-_2D00_-Microsoft-Dynamics-365.png

Plugin Trace:

[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SendEmail]
[SendEmailStep1: send email]

Error Message:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Invalid Party Object Type 9Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>c2a77d06-6a1e-494b-aff5-0dfb1419b828</ActivityId>
<ErrorCode>-2147207930</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>ApiExceptionSourceKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Plugin/Microsoft.Crm.Common.ObjectModel.EmailService</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiOriginalExceptionKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Microsoft.Crm.CrmException: Invalid Party Object Type 9 ---&gt; Microsoft.Crm.CrmException: Invalid Party Object Type 9
at Microsoft.Crm.Common.ObjectModel.ActivityPartyService.Create(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CommunicationActivityServiceBase.CreateCommunicationPartiesInternal(BusinessEntityMoniker moniker, CommunicationActivity activity, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.PostCreateInPipelineEventHandler.Invoke(Object sender, ExtensionEventArgs e)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoCreate(IBusinessEntity entity, ExecutionContext context)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass2_1.&lt;Execute&gt;b__0()</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepKey</d2p1:key>
<d2p1:value xmlns:d4p1="schemas.microsoft.com/.../Serialization" i:type="d4p1:guid">8c3b8615-ecd8-db11-b397-0019b9204da9</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiDepthKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:int">5</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiActivityIdKey</d2p1:key>
<d2p1:value xmlns:d4p1="schemas.microsoft.com/.../Serialization" i:type="d4p1:guid">c2a77d06-6a1e-494b-aff5-0dfb1419b828</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiPluginSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Invalid Party Object Type 9</Message>
<Timestamp>2018-11-06T11:14:24.3114443Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>c2a77d06-6a1e-494b-aff5-0dfb1419b828</ActivityId>
<ErrorCode>-2147207930</ErrorCode>
<ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d3p1:key>ApiExceptionSourceKey</d3p1:key>
<d3p1:value xmlns:d5p1="www.w3.org/.../XMLSchema" i:type="d5p1:string">Plugin/Microsoft.Crm.Common.ObjectModel.EmailService</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiOriginalExceptionKey</d3p1:key>
<d3p1:value xmlns:d5p1="www.w3.org/.../XMLSchema" i:type="d5p1:string">Microsoft.Crm.CrmException: Invalid Party Object Type 9 ---&gt; Microsoft.Crm.CrmException: Invalid Party Object Type 9
at Microsoft.Crm.Common.ObjectModel.ActivityPartyService.Create(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CommunicationActivityServiceBase.CreateCommunicationPartiesInternal(BusinessEntityMoniker moniker, CommunicationActivity activity, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.PostCreateInPipelineEventHandler.Invoke(Object sender, ExtensionEventArgs e)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoCreate(IBusinessEntity entity, ExecutionContext context)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass2_1.&lt;Execute&gt;b__0()</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiStepKey</d3p1:key>
<d3p1:value xmlns:d5p1="schemas.microsoft.com/.../Serialization" i:type="d5p1:guid">8c3b8615-ecd8-db11-b397-0019b9204da9</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiDepthKey</d3p1:key>
<d3p1:value xmlns:d5p1="www.w3.org/.../XMLSchema" i:type="d5p1:int">5</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiActivityIdKey</d3p1:key>
<d3p1:value xmlns:d5p1="schemas.microsoft.com/.../Serialization" i:type="d5p1:guid">c2a77d06-6a1e-494b-aff5-0dfb1419b828</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiPluginSolutionNameKey</d3p1:key>
<d3p1:value xmlns:d5p1="www.w3.org/.../XMLSchema" i:type="d5p1:string">System</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiStepSolutionNameKey</d3p1:key>
<d3p1:value xmlns:d5p1="www.w3.org/.../XMLSchema" i:type="d5p1:string">System</d3p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Invalid Party Object Type 9</Message>
<Timestamp>2018-11-06T11:14:24.3114443Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>c2a77d06-6a1e-494b-aff5-0dfb1419b828</ActivityId>
<ErrorCode>-2147207930</ErrorCode>
<ErrorDetails xmlns:d4p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Invalid Party Object Type 9</Message>
<Timestamp>2018-11-06T11:14:24.3114443Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<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: send email]
</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)

  • Ahmad Saud Profile Picture
    790 on at
    RE: Error while sending email via Workflow

    your solution sounds good but i already had a shorter solution from Mr. Ravi.

    thanks for your help.

  • Suggested answer
    Alexandr J.  Profile Picture
    246 on at
    RE: Error while sending email via Workflow

    Hi Ahmad,

    I encountered this problem a few weeks ago at another entity, problem is (TO)=team and the solution could be to create a distribution sheet at "Active directory domain services" for the team like "cases@companyname.com" where the e-mail recipients will be team members. So you can have owner of case the Team and (TO) will be that distribution sheet.

    Hope this can help you too :)

  • Ahmad Saud Profile Picture
    790 on at
    RE: Error while sending email via Workflow

    thanks Ravi

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Error while sending email via Workflow

    Hi Ahmad,

    From the error message, you have set the "Team" in the "To" party list. As mentioned above & previously, you cannot send email to team but you can send email to queue of that team. In your email screenshot, you have used owner (Case) which could be a team as well, so instead of owner(case) you need to use owning user or queue for owning  team. Just like you did it before in this thread :)

    community.dynamics.com/.../298026

    Hope this helps.

  • Saranya Santhakumaran Profile Picture
    140 on at
    RE: Error while sending email via Workflow

    Hi..

    You cannot sent email to team directly.instead you can use CRM workflow utilities to send email to all the users in the team..

  • Ahmad Saud Profile Picture
    790 on at
    RE: Error while sending email via Workflow

    thanks Goutam, the this is for both (team and user), that is why you will find many variables in the (TO) and one will have a valid user for certain.

    but my question, do you think any of the variables in the (TO) may cause an error if the case is owned by a team or owned by a user?

    my understanding is that at least one variable should have a value in order for this email to go , if all are empty then problem will occur, right?

    thanks.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Error while sending email via Workflow

    Hi Ahmad,

    If I am not wrong the problem is the owner , can you please check with different owner.

    Are you assigning the case to team or user?

  • Ahmad Saud Profile Picture
    790 on at
    RE: Error while sending email via Workflow

    i also attached the email template

    2018_2D00_11_2D00_06-14_5F00_27_5F00_10_2D00_Email_5F00_-New-Email-_2D00_-Microsoft-Dynamics-365.png

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general forum

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans