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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Resolution Plug-in issue case Entity

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am using the Dynamic 365 customer services App online. Today I have created first plugin and registered in sandbox instance for capture and store resolution on case entity using below article.

http://missdynamicscrm.blogspot.com/2015/02/capturing-and-storing-case-resolution-case-entity-CRM.html

But getting this error "an unexpected error occurred from isv code". Kindly suggest me for issue.

pastedimage1587930408116v1.png

Thank you 

vetrivel G

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Based on what you demonstrate I assume you have exception happening in the plugin.

    My recommendation - learn on how to debug plugins, debug the plugin and fix the code.

    Following video demonstrates how you can debug the plugin - www.youtube.com/watch

    Good luck.

  • Community Member Profile Picture
    on at

    Hi All,

    Thank you for your promote response. I debugged plug in found error below. Now I can able to resolve case and stored information case entity. But Here few more question regarding this issue. kindly help me for this.

    1. Can keep plugin profiler solution in sandbox instance. If yes what about production instance.

    2. if small code changes in plug in means every time unregistered plugin and register again CRM any alternative way is there?

    Debug Error

    pastedimage1588055523325v1.png

    Stored Resolution into case Entity

    pastedimage1588055666081v2.png

    Thank you

    vetrivel G

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Seems that approach described in the article doesn't work anymore.

    My recommendation - you can build plugin that handles Resolve message of the case in pre-mode. As an example you can check this post - community.dynamics.com/.../plugin-when-a-case-incident-is-resolved-in-crm-2013

    Good luck.

  • Community Member Profile Picture
    on at

    Hi All,

    Im facing user unhanded exception  while resolving case. Kindly needfully 

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Since case is resolved and read-only, only these attributes are updatable : "ownerid", "owneridyominame", "owneridtype", "owninguser", "statecode", "statuscode", "modifiedon", "modifiedby", "modifiedonbehalfby", "owningbusinessunit" , "processid". If you need to edit other fields, please reactivate the case.

    Detail: <OrganizationServiceFault xmlns="">schemas.microsoft.com/.../Contracts" xmlns:i="">www.w3.org/.../XMLSchema-instance">
    <ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
    <ErrorCode>-2147220970</ErrorCode>
    <ErrorDetails xmlns:a="">schemas.datacontract.org/.../System.Collections.Generic">
    <KeyValuePairOfstringanyType>
    <a:key>CallStack</a:key>
    <a:value i:type="b:string" xmlns:b="">www.w3.org/.../XMLSchema"> at Case_Resolution.CaseResolution.Execute(IServiceProvider serviceProvider)
    at PluginProfiler.Library.PluginAppDomainProxy.ExecuteCore(Stopwatch watch, ProfilerExecutionReport report, Object instance, Object executionParameter)
    at PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)</a:value>
    </KeyValuePairOfstringanyType>
    </ErrorDetails>
    <HelpLink i:nil="true" />
    <Message>Since case is resolved and read-only, only these attributes are updatable : "ownerid", "owneridyominame", "owneridtype", "owninguser", "statecode", "statuscode", "modifiedon", "modifiedby", "modifiedonbehalfby", "owningbusinessunit" , "processid". If you need to edit other fields, please reactivate the case.</Message>
    <Timestamp>2020-04-29T08:22:05.2590843Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
    </OrganizationServiceFault>

    Thank you

    vetrivel G

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    The reason is written in "Message". Here it is:

    Since case is resolved and read-only, only these attributes are updatable : "ownerid", "owneridyominame", "owneridtype", "owninguser", "statecode", "statuscode", "modifiedon", "modifiedby", "modifiedonbehalfby", "owningbusinessunit" , "processid". If you need to edit other fields, please reactivate the case.

    I provided the way on how to implement your scenario in my previous reply.

  • Community Member Profile Picture
    on at

    Hi Andrew,

    In that only code is there, There is no steps. If I can follow above articles. Can store resolution in case Entity.

    what are the fields I need create in case Entity. Kindly needful.

    Thank you

    Vetrivel G

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    You can use same fields that you created before and access data you need from "insidentresolution".

  • Suggested answer
    ZeeshanGhause Profile Picture
    on at

    Hi Partner!

    Case is already resolved (then it become read only)and you are trying to update that resolved case so it is not supported okay.

    First of all you have to reactivate that case and then you can update that case and after that resolve/close that case that's it

    Follow this simple steps

    community.dynamics.com/.../updating-resolved-cases-in-dynamics-365

    Regards,

    Zeeshan  

  • Community Member Profile Picture
    on at

    Hi Andrew,

     I have tired below code it's through same error. No changes. any alternative way is there.

    Plugin Code

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.ServiceModel;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Query;

    namespace CaseResolution
    {
    public class Resolution : IPlugin

    {
    public void Execute(IServiceProvider serviceProvider)
    {
    // Obtain the execution context from the service provider.
    IPluginExecutionContext context = (IPluginExecutionContext)
    serviceProvider.GetService(typeof(IPluginExecutionContext));

    if (context.InputParameters.Contains("IncidentResolution"))
    {
    Entity incidentResolution = (Entity)context.InputParameters["IncidentResolution"];
    Guid relatedIncidentGuid = ((EntityReference)incidentResolution.Attributes["incidentid"]).Id;
    DateTime actualEnd = DateTime.Now;
    if (incidentResolution.Contains("actualend"))
    {
    actualEnd = (DateTime)incidentResolution.Attributes["actualend"];
    }
    // Obtain the organization service reference.
    IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
    IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

    // Get created on of incident

    Entity retrievedIncident = service.Retrieve("incident", relatedIncidentGuid, new ColumnSet(true));
    DateTime createdOn = (DateTime)retrievedIncident.Attributes["createdon"];

    TimeSpan totalTimeSpent = actualEnd.Subtract(createdOn);

    Entity incident = new Entity("incident");
    incident.Id = relatedIncidentGuid;
    incident.Attributes["new_duration"] = totalTimeSpent.TotalMinutes;
    service.Update(incident);

    }


    throw new NotImplementedException();
    }
    }
    }

    Error Code

    pastedimage1588141270866v1.png

    Thank you

    vetrivel G

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Your code throws an exception at the end. It will never work fine - throw new NotImplementedException();

    And as I mentioned before - troubleshoot the plugin to find the answer why it doesn't work.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 73 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

#3
Scott Jackson UK Profile Picture

Scott Jackson UK 22

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans