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

Hi,

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;

Bye.


Author: Nishant Rana

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

1 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 =
    (CloseIncidentResponse)service.Execute(close);

    Like

Share your thoughts

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s