Hi All,
Please find the below steps to trigger plugin for Case Close.
Pass Parameter as IncidentResolution
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = factory.CreateOrganizationService(context.UserId);
if (context.InputParameters.Contains("IncidentResolution"))
{
Entity incidentResolution = (Entity)context.InputParameters["IncidentResolution"];
Guid relatedIncidentGuid = ((EntityReference)incidentResolution.Attributes["incidentid"]).Id;
}
IncidentResolution is a special entity that holds the information about the incident record that is being closed.
No comments:
Post a Comment