Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Deleting Cases

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a sandbox crm online environment (9.0).

I have a number of Cases that when I try to delete them I get this error message

{"error":{"code":"0x80040217","message":"ServiceAppointment With Id = 0ba10951-c216-e811-a835-000d3ae0eb6e Does Not Exist","innererror":{"message":"ServiceAppointment With Id = 0ba10951-c216-e811-a835-000d3ae0eb6e 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.Delete(EntityReference entityReference, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Boolean checkOptimisticConcurrency)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Delete(EntityReference entityReference, Boolean checkForOptimisticConcurrency)\r\n   at Microsoft.Crm.Extensibility.OData.EntityController.DeleteEntity(String entityName, String key)\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.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\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.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\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.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}}}

There are NO service appointments in the CRM - why is it trying to find one to delete? How can I delete the Cases?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Deleting Cases

    it would appear that any activity associated with the case including case resolution activities produces this error. If I delete the case resolution first then it is ok.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Deleting Cases

    It does nothing with service appointment

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Deleting Cases

    Can you check whats the logic on that workflow? It is possible that that workflow is creating & associating the service appointment?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Deleting Cases

    I tried that - same result

  • RE: Deleting Cases

    Hi Peter

    I also faced the same issue. It seems to be arising because of the related Activities to a particular Case. Try and delete the related activities and then your Case can be deleted.

    It might be because of the parental aspect of Activities for Cases.

    Thanks

    Vandana

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Deleting Cases

    No different cases have different service appt ids.

    It only seems to effect cases created from a workflow

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Deleting Cases

    Hi,

    In all the errors, it it showing the sme id for service appointment or different?

    Did you import these cases from other environment?

    Is it happening if you create a case and then delete it?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Deleting Cases

    There is no custom logic

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Deleting Cases

    Did you check if there is any custom logic on case delete ??

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans