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.
But getting this error "an unexpected error occurred from isv code". Kindly suggest me for issue.
Thank you
vetrivel G
Hi Andrew,
Currently resolution is stored in timeline below image.
I need to store resolution custom field in case entity( e.g: resolution). like below picture. If it is possible share links
Thank you
vetrivel G
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.
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.
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
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.
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
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
Comment that line out. It just throws an exception without any reason.
Hi Andrew
I have tried to troubleshooted issue. Facing below exception issue.
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
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.
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
Thank you
vetrivel G
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
Muhammad Shahzad Sh...
51
Most Valuable Professional
Ramesh Kumar
42
David Shaw_UK
27