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 :
Microsoft Dynamics CRM (Archived)

Incident with ID Does Not Exist Error

(0) ShareShare
ReportReport
Posted on by 990

Hi All,

We have plugin register on Case entity with post operation, wherein we have condition that while saving the case record close the case automatically, below is the code snippet;

We are upgrading our CRM from CRM 2011 to CRM 2016. The same line of code got executed in CRM 2011, CRM 2013 and CRM 2015, but its throwing ID does not exist error in CRM 2016. Could you please help me here.

Entity caseResolution = new Entity();
caseResolution.LogicalName = "incidentresolution";
caseResolution.Id = Guid.Empty;
caseResolution["incidentid"] = new EntityReference() { Id = incidentId, LogicalName = "incident" };
caseResolution["subject"] = title;

caseResolution["actualend"] = DateTime.UtcNow;

OrganizationRequest request = new OrganizationRequest() { RequestName = "CloseIncident" };
request["IncidentResolution"] = caseResolution;

request["Status"] = new OptionSetValue() { Value = 950000015 }; //950000015=Submitted  

service.Execute(request);

Regards,

Rahul

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    Hi Rahul,

    Is there any other Sync Plugin/Workflow running on Case Resolution? or any other action you are performing as soon as case get resolved. Like, send email/SMS?

    Also, try using below syntax in order to close the case:

    IncidentResolution resolution = new IncidentResolution
    {
    Subject = "Resolved Sample Incident",
    IncidentId = new EntityReference(Incident.EntityLogicalName, _incidentId)
    };

    // Close the incident with the resolution.
    CloseIncidentRequest request = new CloseIncidentRequest
    {
    IncidentResolution = incidentResolution,
    Status = new OptionSetValue((int)incident_statuscode.ProblemSolved)
    };

    CloseIncidentResponse closeResponse = (CloseIncidentResponse)service.Execute(closeIncidentRequest);

    -Arpit

  • Rahul-Waghmare Profile Picture
    990 on at

    Hi Arpit,

    Thanks for reply, yes we do have send email functionality before case get resolved.

    I got this code snippet which you suggested, but my question here is, the same code runs on CRM 2011, CRM 2013 and CRM 2015, then what is the issue with CRM 2016.

    Regards,

    Rahul

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Rahul,

    Seems the issue is here in below line .Since the sdk dll you are referencing in plugin is old version.

    IncidentId = new EntityReference(Incident.EntityLogicalName, _incidentId)

    Try to update sdk dll  8.1 version probably you can not build your plugin you will get error with additional parameters _incidentId here in above line.

    Try to fix this issue . Hopefully it will work.

  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    Hi Rahul,

    The only thought coming in my mind regarding version change is the way to close the incident using plugin/c#. Probably Microsoft has changed something in DLLs.

    So better to give a try with the code that I had shared with you earlier so that we can atleast get the direction to find the root cause and investigate it further.

    Hope it works.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans