Getting the IncidentId on resolving a Case in post Close plugin.


To get the id of the case record which is getting resolved in the plugin, we need to make use of IncidentResolution inputparameters of the context.

Entity incRes = this.Context.InputParameters["IncidentResolution"] as Entity;
 Guid caseId = ((EntityReference)incRes.Attributes["incidentid"]).Id;


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

One thought on “Getting the IncidentId on resolving a Case in post Close plugin.”

  1. hi! i am having a problem on resolving a case using retrieved guid from crm 2011. do u know any solutions? please advice me, thanks.

    here is my code:

    Entity caseResolution = new Entity(“incidentresolution”);

    Guid caseId = (Guid)entity.Attributes[“incidentid”];

    caseResolution[“incidentid”] = new EntityReference(“incident”, caseId);
    caseResolution[“subject”] = “Resolved!”;

    CloseIncidentRequest close = new CloseIncidentRequest();
    close.IncidentResolution = caseResolution;
    close.RequestName = “CloseIncident”;
    close.Status = new OptionSetValue(5);

    CloseIncidentResponse closeCase =


Please share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.