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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamics 365 - Record ...
Power Automate
Unanswered

Dynamics 365 - Record creation email to case Flow failed

(0) ShareShare
ReportReport
Posted on by 2

We have upgraded our Dynamics 365 to 2020 wave 1 and now our workflow for email to case has failed. So we used the new automatic record creation that uses power automate to create the rule for creating a case. However, when we now receive emails to our support email the  create primary entity part fails with error.

 

 

 

 

This seems to be because the flow uses the sender email to work out the contact and the account for that contact. It initializes  customer variable from the sender email.

 

Create Primary entity case 2.jpg

Then it works out to set parent of sender as customer

 

if(empty(outputs('Retrieve_sender_contact')?['body/_parentcustomerid_value']),outputs('Retrieve_sender_contact')?['body/@odata.id'],concat('contacts(',outputs('Retrieve_sender_contact')?['body/_parentcustomerid_value'], ')'))

 

Then it should place the result in here however it fails.

 

Create Primary entity case.jpg

 

 
{
"error": {
"code": "0x80040217",
"message": "Contact With Id = 167683cd-e79b-e911-a981-000d3a246a83 Does Not Exist",
"innererror": {
"message": "Contact With Id = 167683cd-e79b-e911-a981-000d3a246a83 Does Not Exist",
"type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
"stacktrace": " at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.CreateInternal(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.CreateOrganizationResponse(Entity entity)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\r\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String& entitySetName, EdmEntityObject entityObject)\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
 

Any help would be appreciated.

 

Nick

 
 
Categories:
I have the same question (0)
  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    hi @Cencom  it seems like the IDs are changed. Please could you use get records to list the conctacs and compare the ids? just to try.

  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    Hi @Cencom 

     

    Generally upgrades won't change the Id's. Couple of questions

     

    1. Is this a new flow you are building?

    2. Could you post a screen shot of your flow?

    3. I can see a variable mapping from your screen shot. Is that a lookup in Dynamics 365?

    4. Are you using CDS or Dynamics connector for this flow?

     

    Thanks

  • Nick Portch - CenCom Solutions Profile Picture
    2 on at

    Hi Yes I see what you mean the Customer (Contacts) is using the Customer (Account) id

    hence it cant find it. It uses this part of the flow to find the account info but then puts that in 2 places

     

    Email to Case .jpg

     

     Should I use the sender value as below?

     

    Email to Case 2.jpg

     

    In answer to the other questions.

     

    Yes it is a new flow but it's the default that's created when you use the automatic record creation in dynamics as it now uses power automate. Which surprises me as it doesn't work.

     

  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    Hi @Cencom 

     

    It's difficult to say you can use Sender. Also to update the lookup field in CDS you need to use the below syntax. You need the entityname and GUID

     

    image.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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 506 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 425 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard