Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

Resolution Plug-in issue case Entity

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolution Plug-in issue case Entity

    Hi Andrew,

    Currently resolution is stored in timeline below image. 

    pastedimage1588152053861v1.png

    I need to store resolution custom field in case entity( e.g: resolution). like below picture. If it is possible share links 

    pastedimage1588152337878v2.png

    Thank you

    vetrivel G

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Resolution Plug-in issue case Entity

    1. After the change you need only build assembly and update it using Plugin Registration Tool.

    2. To move it to production I would recommend to use solutions - add plugin assembly/plugin steps to solution, export from dev, import to production.

    3. Not sure what you mean here.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolution Plug-in issue case Entity

    Hi Andrew,

    Please note, I;m new for CRM and learning and as well developing customer engagement. Now I can able to see resolution in case entity. thank you promote response, helped for this issue. I'm really appreciate time and effort.

    pastedimage1588148602590v1.png 

    Few more Question:

    1.If small code changes in plug in means every time can I unregistered plugin and register again CRM or any alternative way is there?

    2.Can perform same steps in into production instance?

    3. If any possible to display resolution in the resolved form on case entity?

    Once again  Thank you

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Resolution Plug-in issue case Entity

    Wrong entity and wrong message for step. It should be incident for entity and resolve for message.

    Don't get me wrong - I will not babysit you. I gave you all tools you need and it's up to you to figure out what is wrong.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolution Plug-in issue case Entity

    Hi Andrew,

    Now case is resolved in normal mode, Resolution not storied in case entity and debug mode couldn't find any errors. Below image is register plug in steps I followed

    pastedimage1588145497468v2.png

    Plug in Trace

    Profiler> Plug-in AppDomain Created
    Profiler> Parsed Profiler File Successfully.
    Profiler> Constructor Execution Started: 04/29/2020 20:49:54
    Profiler> Constructor Execution Completed Successfully (Duration = 0ms).
    Profiler> Profiler Execution Started: 04/29/2020 20:49:54
    Profiler> Profiler Execution Completed Successfully (Duration = 1ms).
    Profiler> Profiler AppDomain Unloaded.

    Thank you

    vetrivel G

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Resolution Plug-in issue case Entity

    Comment that line out. It just throws an exception without any reason.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolution Plug-in issue case Entity

    Hi Andrew

    I have tried to troubleshooted issue. Facing below exception issue.

    pastedimage1588143974754v1.png

    Now plug in working only debug mode. I can able to resolve case and it's storing resolution in case entity. But after uninstalled profiler in sandbox and plugin again not able to store resolution in the case entity.  Kindly suggest me you answer.

    Thank you

    vetrivel G

     

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Resolution Plug-in issue case Entity

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolution Plug-in issue case Entity

    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

  • Suggested answer
    RE: Resolution Plug-in issue case Entity

    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  

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans